Exception: JsonApiClient::ClientError
- Defined in:
- lib/json_api_client/error.rb
Direct Known Subclasses
ConnectionFailed, ParsingError, ResourceNotFound, SSLError, TimeoutError
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(ex) ⇒ ClientError
constructor
A new instance of ClientError.
- #inspect ⇒ Object
Constructor Details
#initialize(ex) ⇒ ClientError
Returns a new instance of ClientError.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/json_api_client/error.rb', line 6 def initialize(ex) @wrapped_exception = nil if ex.respond_to?(:backtrace) super(ex.) @wrapped_exception = ex elsif ex.respond_to?(:each_key) super("the server responded with status #{ex[:status]}") else super(ex.to_s) end end |
Instance Method Details
#backtrace ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/json_api_client/error.rb', line 19 def backtrace if @wrapped_exception @wrapped_exception.backtrace else super end end |
#inspect ⇒ Object
27 28 29 |
# File 'lib/json_api_client/error.rb', line 27 def inspect %(#<#{self.class}>) end |