Exception: StrixRuby::APIError
- Defined in:
- lib/strix_ruby/errors.rb
Overview
Raised when the API returns an error response
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, body: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message = nil, status: nil, body: nil) ⇒ APIError
Returns a new instance of APIError.
18 19 20 21 22 |
# File 'lib/strix_ruby/errors.rb', line 18 def initialize( = nil, status: nil, body: nil) @status = status @body = body super( || "API request failed with status #{status}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
16 17 18 |
# File 'lib/strix_ruby/errors.rb', line 16 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
16 17 18 |
# File 'lib/strix_ruby/errors.rb', line 16 def status @status end |