Exception: CirroIOV2::Errors::ClientError
- Inherits:
-
StandardError
- Object
- StandardError
- CirroIOV2::Errors::ClientError
- Extended by:
- Forwardable
- Defined in:
- lib/cirro_io_v2/errors/client_error.rb
Instance Attribute Summary collapse
-
#faraday_error ⇒ Object
readonly
Returns the value of attribute faraday_error.
Instance Method Summary collapse
-
#initialize(faraday_error) ⇒ ClientError
constructor
this error class is intended to be used ONLY for 4xx errors www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError.
- #message ⇒ Object
Constructor Details
#initialize(faraday_error) ⇒ ClientError
this error class is intended to be used ONLY for 4xx errors www.rubydoc.info/github/lostisland/faraday/Faraday/ClientError
15 16 17 |
# File 'lib/cirro_io_v2/errors/client_error.rb', line 15 def initialize(faraday_error) @faraday_error = faraday_error end |
Instance Attribute Details
#faraday_error ⇒ Object (readonly)
Returns the value of attribute faraday_error.
10 11 12 |
# File 'lib/cirro_io_v2/errors/client_error.rb', line 10 def faraday_error @faraday_error end |
Instance Method Details
#message ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/cirro_io_v2/errors/client_error.rb', line 19 def puts faraday_error.response.inspect faraday_error.response.then do |response| return response.inspect if ENV.fetch('DEBUG_CIRRO_RUBY_CLIENT', false) faraday_error.response[:body].presence || faraday_error.try(:message) end end |