Exception: Zizq::ResponseError
- Defined in:
- lib/zizq/error.rb,
sig/generated/zizq/error.rbs
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 ⇒ Hash[String, untyped]?
readonly
The decoded body of the error response.
-
#status ⇒ Integer
readonly
The HTTP response status from the Zizq server.
Instance Method Summary collapse
-
#initialize(message, status:, body: nil) ⇒ Object
constructor
Create a new ResponseError with the given error message, response status and decoded response body.
Constructor Details
#initialize(message, status:, body: nil) ⇒ Object
Create a new ResponseError with the given error message, response status and decoded response body.
27 28 29 30 31 |
# File 'lib/zizq/error.rb', line 27 def initialize(, status:, body: nil) #: (String, status: Integer, ?body: Hash[String, untyped]?) -> void @status = status @body = body super() end |
Instance Attribute Details
#body ⇒ Hash[String, untyped]? (readonly)
The decoded body of the error response.
23 24 25 |
# File 'lib/zizq/error.rb', line 23 def body @body end |
#status ⇒ Integer (readonly)
The HTTP response status from the Zizq server.
20 21 22 |
# File 'lib/zizq/error.rb', line 20 def status @status end |