Exception: Finlight::ApiError
- Defined in:
- lib/finlight/errors.rb
Overview
Raised when the API responds with a non-success status code.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(status_code, body) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(status_code, body) ⇒ ApiError
Returns a new instance of ApiError.
11 12 13 14 15 |
# File 'lib/finlight/errors.rb', line 11 def initialize(status_code, body) @status_code = status_code @body = body super("finlight: API request failed with status #{status_code}: #{body}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/finlight/errors.rb', line 9 def body @body end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
9 10 11 |
# File 'lib/finlight/errors.rb', line 9 def status_code @status_code end |