Exception: VistarClient::APIError
- Defined in:
- lib/vistar_client/error.rb
Overview
Raised when the API returns an error response (HTTP 4xx/5xx).
This error includes the HTTP status code and response body for debugging.
Instance Attribute Summary collapse
-
#response_body ⇒ Hash, ...
readonly
Response body from the error response.
-
#status_code ⇒ Integer?
readonly
HTTP status code from the error response.
Instance Method Summary collapse
-
#initialize(message, status_code: nil, response_body: nil) ⇒ APIError
constructor
Initialize an APIError with optional HTTP details.
Constructor Details
#initialize(message, status_code: nil, response_body: nil) ⇒ APIError
Initialize an APIError with optional HTTP details.
58 59 60 61 62 |
# File 'lib/vistar_client/error.rb', line 58 def initialize(, status_code: nil, response_body: nil) super() @status_code = status_code @response_body = response_body end |
Instance Attribute Details
#response_body ⇒ Hash, ... (readonly)
Returns Response body from the error response.
50 51 52 |
# File 'lib/vistar_client/error.rb', line 50 def response_body @response_body end |
#status_code ⇒ Integer? (readonly)
Returns HTTP status code from the error response.
47 48 49 |
# File 'lib/vistar_client/error.rb', line 47 def status_code @status_code end |