Exception: Deltacloud::Client::BaseError
- Defined in:
- lib/deltacloud/client/base_error.rb
Direct Known Subclasses
AuthenticationError, BackendError, ClientFailure, NotFound, ServerError
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#original_error ⇒ Object
readonly
Returns the value of attribute original_error.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#server_backtrace ⇒ Object
readonly
Returns the value of attribute server_backtrace.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ BaseError
constructor
A new instance of BaseError.
-
#set_backtrace(backtrace) ⇒ Object
If the Deltacloud API server error response contain backtrace from server,then make this backtrace available as part of this exception backtrace.
Constructor Details
#initialize(opts = {}) ⇒ BaseError
Returns a new instance of BaseError.
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/deltacloud/client/base_error.rb', line 29 def initialize(opts={}) if opts.is_a? Hash @server_backtrace = opts[:server_backtrace] @driver = opts[:driver] @provider = opts[:provider] @status = opts[:status] @original_error = opts[:original_error] super(opts[:message]) else super(opts) end end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
24 25 26 |
# File 'lib/deltacloud/client/base_error.rb', line 24 def driver @driver end |
#original_error ⇒ Object (readonly)
Returns the value of attribute original_error.
27 28 29 |
# File 'lib/deltacloud/client/base_error.rb', line 27 def original_error @original_error end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
25 26 27 |
# File 'lib/deltacloud/client/base_error.rb', line 25 def provider @provider end |
#server_backtrace ⇒ Object (readonly)
Returns the value of attribute server_backtrace.
23 24 25 |
# File 'lib/deltacloud/client/base_error.rb', line 23 def server_backtrace @server_backtrace end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
26 27 28 |
# File 'lib/deltacloud/client/base_error.rb', line 26 def status @status end |
Instance Method Details
#set_backtrace(backtrace) ⇒ Object
If the Deltacloud API server error response contain backtrace from server,then make this backtrace available as part of this exception backtrace
46 47 48 49 50 51 52 53 |
# File 'lib/deltacloud/client/base_error.rb', line 46 def set_backtrace(backtrace) return super(backtrace) if @server_backtrace.nil? super([ backtrace[0..3], "-------Deltacloud API backtrace-------", @server_backtrace.split[0..10], ].flatten) end |