Exception: Wiq::APIError
Overview
Mirror of the HTTP error envelope from /api/v1.
Instance Attribute Summary collapse
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from Error
#code, #details, #exit_code, #hint
Instance Method Summary collapse
-
#initialize(status:, body:, request_id: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(status:, body:, request_id: nil) ⇒ APIError
Returns a new instance of APIError.
82 83 84 85 86 87 88 89 |
# File 'lib/wiq/errors.rb', line 82 def initialize(status:, body:, request_id: nil) @status = status @response_body = body @request_id = request_id code, , hint = derive(status, body) super(, code: code, hint: hint, exit_code: 1, details: body) end |
Instance Attribute Details
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
80 81 82 |
# File 'lib/wiq/errors.rb', line 80 def request_id @request_id end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
80 81 82 |
# File 'lib/wiq/errors.rb', line 80 def response_body @response_body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
80 81 82 |
# File 'lib/wiq/errors.rb', line 80 def status @status end |