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.
44 45 46 47 48 |
# File 'lib/xshellz/errors.rb', line 44 def initialize(, status:, body: nil) super() @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
42 43 44 |
# File 'lib/xshellz/errors.rb', line 42 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
42 43 44 |
# File 'lib/xshellz/errors.rb', line 42 def status @status end |