Exception: Postscale::APIError
- Defined in:
- lib/postscale/errors.rb
Overview
Structured error object returned inside Postscale::Result for API and transport failures. API responses are not raised by public SDK methods.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#request_id ⇒ Object
readonly
Returns the value of attribute request_id.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message:, code: "api_error", status_code: nil, request_id: nil, body: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message:, code: "api_error", status_code: nil, request_id: nil, body: nil) ⇒ APIError
Returns a new instance of APIError.
18 19 20 21 22 23 24 |
# File 'lib/postscale/errors.rb', line 18 def initialize(message:, code: "api_error", status_code: nil, request_id: nil, body: nil) @code = code @status_code = status_code @request_id = request_id @body = body super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
16 17 18 |
# File 'lib/postscale/errors.rb', line 16 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
16 17 18 |
# File 'lib/postscale/errors.rb', line 16 def code @code end |
#request_id ⇒ Object (readonly)
Returns the value of attribute request_id.
16 17 18 |
# File 'lib/postscale/errors.rb', line 16 def request_id @request_id end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
16 17 18 |
# File 'lib/postscale/errors.rb', line 16 def status_code @status_code end |