Exception: Faraday::Error::ClientError
- Defined in:
- lib/faraday/error.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.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/faraday/error.rb', line 6 def initialize(ex, response = nil) @wrapped_exception = nil @response = response if ex.respond_to?(:backtrace) super(ex.) @wrapped_exception = ex elsif ex.respond_to?(:each_key) super("the server responded with status #{ex[:status]}") @response = ex else super(ex.to_s) end end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/faraday/error.rb', line 4 def response @response end |