Exception: Boldsign::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Boldsign::Error
- Defined in:
- lib/boldsign/error.rb
Overview
Base class for all errors raised by this gem. HTTP failures raise a typed subclass; carry the status code, parsed body, and Faraday response.
Direct Known Subclasses
AuthenticationError, BadRequestError, ConfigurationError, ForbiddenError, NotFoundError, RateLimitError, ServerError, UnprocessableEntityError
Instance Attribute Summary collapse
-
#body ⇒ Hash, ...
readonly
Parsed response body (JSON Hash) or raw body string.
-
#response ⇒ Faraday::Response?
readonly
Underlying Faraday response.
-
#status ⇒ Integer?
readonly
HTTP status code, when the error originated from a response.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, body: nil, response: nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message = nil, status: nil, body: nil, response: nil) ⇒ Error
Returns a new instance of Error.
12 13 14 15 16 17 |
# File 'lib/boldsign/error.rb', line 12 def initialize( = nil, status: nil, body: nil, response: nil) super() @status = status @body = body @response = response end |
Instance Attribute Details
#body ⇒ Hash, ... (readonly)
Returns parsed response body (JSON Hash) or raw body string.
8 9 10 |
# File 'lib/boldsign/error.rb', line 8 def body @body end |
#response ⇒ Faraday::Response? (readonly)
Returns underlying Faraday response.
10 11 12 |
# File 'lib/boldsign/error.rb', line 10 def response @response end |
#status ⇒ Integer? (readonly)
Returns HTTP status code, when the error originated from a response.
6 7 8 |
# File 'lib/boldsign/error.rb', line 6 def status @status end |