Exception: Apertur::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Apertur::Error
- Defined in:
- lib/apertur/errors.rb
Overview
Base error class for all Apertur API errors.
Direct Known Subclasses
AuthenticationError, NotFoundError, RateLimitError, ValidationError
Instance Attribute Summary collapse
-
#code ⇒ String?
readonly
the error code returned by the API.
-
#status_code ⇒ Integer?
readonly
the HTTP status code.
Instance Method Summary collapse
-
#initialize(message, status_code: nil, code: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, status_code: nil, code: nil) ⇒ Error
Returns a new instance of Error.
14 15 16 17 18 |
# File 'lib/apertur/errors.rb', line 14 def initialize(, status_code: nil, code: nil) super() @status_code = status_code @code = code end |
Instance Attribute Details
#code ⇒ String? (readonly)
the error code returned by the API
8 9 10 |
# File 'lib/apertur/errors.rb', line 8 def code @code end |
#status_code ⇒ Integer? (readonly)
the HTTP status code
8 9 10 |
# File 'lib/apertur/errors.rb', line 8 def status_code @status_code end |