Exception: Pike13::APIError
- Defined in:
- lib/pike13/errors.rb
Overview
Base class for all API-related errors Provides access to HTTP status and response body
Direct Known Subclasses
AuthenticationError, BadRequestError, NotFoundError, RateLimitError, ServerError, ValidationError
Instance Attribute Summary collapse
-
#http_status ⇒ Integer?
readonly
HTTP status code from the API.
-
#response_body ⇒ Hash, ...
readonly
Response body from the API.
Instance Method Summary collapse
-
#initialize(message = nil, http_status: nil, response_body: nil) ⇒ APIError
constructor
A new instance of APIError.
Constructor Details
#initialize(message = nil, http_status: nil, response_body: nil) ⇒ APIError
Returns a new instance of APIError.
24 25 26 27 28 |
# File 'lib/pike13/errors.rb', line 24 def initialize( = nil, http_status: nil, response_body: nil) @http_status = http_status @response_body = response_body super() end |
Instance Attribute Details
#http_status ⇒ Integer? (readonly)
HTTP status code from the API
18 19 20 |
# File 'lib/pike13/errors.rb', line 18 def http_status @http_status end |
#response_body ⇒ Hash, ... (readonly)
Response body from the API
18 19 20 |
# File 'lib/pike13/errors.rb', line 18 def response_body @response_body end |