Exception: Hanko::ApiError
Overview
Raised when the Hanko API returns an HTTP 4xx or 5xx response.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Hash?
readonly
The parsed response body.
-
#status ⇒ Integer?
readonly
The HTTP status code.
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.
33 34 35 36 37 |
# File 'lib/hanko/errors.rb', line 33 def initialize( = nil, status: nil, body: nil) @status = status @body = body super() end |
Instance Attribute Details
#body ⇒ Hash? (readonly)
Returns the parsed response body.
28 29 30 |
# File 'lib/hanko/errors.rb', line 28 def body @body end |
#status ⇒ Integer? (readonly)
Returns the HTTP status code.
25 26 27 |
# File 'lib/hanko/errors.rb', line 25 def status @status end |