Exception: Quolle::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Quolle::Error
- Defined in:
- lib/quolle/error.rb
Overview
Raised when the Quolle API returns a non-2xx response, or a request could not be completed (network/timeout).
Instance Attribute Summary collapse
-
#data ⇒ Hash
readonly
Extra fields returned alongside
error. -
#status_code ⇒ Integer?
readonly
HTTP status code, or nil for transport failures.
Instance Method Summary collapse
-
#initialize(message, status_code: nil, data: {}) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, status_code: nil, data: {}) ⇒ Error
Returns a new instance of Error.
12 13 14 15 16 |
# File 'lib/quolle/error.rb', line 12 def initialize(, status_code: nil, data: {}) super() @status_code = status_code @data = data || {} end |
Instance Attribute Details
#data ⇒ Hash (readonly)
Returns extra fields returned alongside error.
10 11 12 |
# File 'lib/quolle/error.rb', line 10 def data @data end |
#status_code ⇒ Integer? (readonly)
Returns HTTP status code, or nil for transport failures.
8 9 10 |
# File 'lib/quolle/error.rb', line 8 def status_code @status_code end |