Exception: Centro::Error::ClientError
- Defined in:
- lib/centro/errors.rb
Direct Known Subclasses
ConnectionFailed, ParsingError, ResourceNotFound, TimeoutError
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(ex, response = nil) ⇒ ClientError
constructor
A new instance of ClientError.
- #inspect ⇒ Object
Constructor Details
#initialize(ex, response = nil) ⇒ ClientError
Returns a new instance of ClientError.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/centro/errors.rb', line 9 def initialize(ex, response = nil) @wrapped_exception = nil @response = response if ex.respond_to?(:backtrace) super(ex.) @wrapped_exception = ex else super(ex.to_s) end end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/centro/errors.rb', line 7 def response @response end |
Instance Method Details
#backtrace ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/centro/errors.rb', line 21 def backtrace if @wrapped_exception @wrapped_exception.backtrace else super end end |
#inspect ⇒ Object
29 30 31 |
# File 'lib/centro/errors.rb', line 29 def inspect %(#<#{self.class}>) end |