Exception: Zizq::ResponseError
- Defined in:
- lib/zizq/error.rb
Overview
HTTP error — the server returned a non-success status code. Carries the status code and parsed body.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
The decoded body of the error response.
-
#status ⇒ Object
readonly
The HTTP response status from the Zizq server.
Instance Method Summary collapse
-
#initialize(message, status:, body: nil) ⇒ ResponseError
constructor
Create a new ResponseError with the given error message, response status and decoded response body.
Constructor Details
#initialize(message, status:, body: nil) ⇒ ResponseError
Create a new ResponseError with the given error message, response status and decoded response body.
25 26 27 28 29 |
# File 'lib/zizq/error.rb', line 25 def initialize(, status:, body: nil) #: (String, status: Integer, ?body: Hash[String, untyped]?) -> void @status = status @body = body super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
The decoded body of the error response.
21 22 23 |
# File 'lib/zizq/error.rb', line 21 def body @body end |
#status ⇒ Object (readonly)
The HTTP response status from the Zizq server.
18 19 20 |
# File 'lib/zizq/error.rb', line 18 def status @status end |