Exception: Tomba::Exception
- Inherits:
-
StandardError
- Object
- StandardError
- Tomba::Exception
- Defined in:
- lib/tomba/exception.rb
Overview
Custom exception class for Tomba API errors.
Raised when the API returns an error response or when required parameters are missing.
Instance Attribute Summary collapse
-
#code ⇒ Integer?
readonly
the HTTP status code or error code.
-
#response ⇒ Hash?
readonly
the full error response body.
Instance Method Summary collapse
-
#initialize(message, code = nil, response = nil) ⇒ Exception
constructor
A new instance of Exception.
Constructor Details
#initialize(message, code = nil, response = nil) ⇒ Exception
Returns a new instance of Exception.
15 16 17 18 19 |
# File 'lib/tomba/exception.rb', line 15 def initialize(, code = nil, response = nil) super() @code = code @response = response end |
Instance Attribute Details
#code ⇒ Integer? (readonly)
the HTTP status code or error code
11 12 13 |
# File 'lib/tomba/exception.rb', line 11 def code @code end |
#response ⇒ Hash? (readonly)
the full error response body
11 12 13 |
# File 'lib/tomba/exception.rb', line 11 def response @response end |