Exception: Xshellz::ApiError
- Defined in:
- lib/xshellz/errors.rb
Overview
Any other non-success API response (4xx/5xx).
Carries the HTTP status and the parsed JSON body (or the raw text when
the response was not JSON).
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, status:, body: nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message, status:, body: nil) ⇒ ApiError
Returns a new instance of ApiError.
35 36 37 38 39 |
# File 'lib/xshellz/errors.rb', line 35 def initialize(, status:, body: nil) super() @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
33 34 35 |
# File 'lib/xshellz/errors.rb', line 33 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
33 34 35 |
# File 'lib/xshellz/errors.rb', line 33 def status @status end |