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 |
# File 'lib/cirro_io_v2/errors/client_error.rb', line 19 def return faraday_error.response.inspect if ENV['DEBUG_CIRRO_RUBY_CLIENT'] body = faraday_error.response&.dig(:body) result = body.presence || faraday_error.try(:message) result.is_a?(String) ? result : result.to_json end |