Exception: Bento::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Bento::Error
- Defined in:
- lib/bento/core/error.rb,
lib/bento-sdk.rb
Overview
Custom error class for handling Bento API errors. This class encapsulates the HTTP response and provides a formatted error message for easier debugging and error handling.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
-
.raise_with_response(response) ⇒ Object
Raises an instance of Bento::Error with the given response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response) ⇒ Error
Returns a new instance of Error.
8 9 10 11 |
# File 'lib/bento/core/error.rb', line 8 def initialize(response) @response = response super() end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/bento/core/error.rb', line 6 def response @response end |
Class Method Details
.raise_with_response(response) ⇒ Object
Raises an instance of Bento::Error with the given response
14 15 16 |
# File 'lib/bento/core/error.rb', line 14 def self.raise_with_response(response) raise new(response) end |