Exception: ReductoAI::Error
- Inherits:
-
StandardError
- Object
- StandardError
- ReductoAI::Error
- Defined in:
- lib/reducto_ai/errors.rb
Overview
Base error class for all Reducto API errors.
All API-related exceptions inherit from this class and include HTTP status code and response body for debugging.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Hash, ...
readonly
Response body.
-
#status ⇒ Integer?
readonly
HTTP status code.
Instance Method Summary collapse
-
#initialize(message = nil, status: nil, body: nil) ⇒ Error
constructor
Creates a new error instance.
Constructor Details
#initialize(message = nil, status: nil, body: nil) ⇒ Error
Creates a new error instance.
31 32 33 34 35 |
# File 'lib/reducto_ai/errors.rb', line 31 def initialize( = nil, status: nil, body: nil) super() @status = status @body = body end |
Instance Attribute Details
#body ⇒ Hash, ... (readonly)
Returns Response body.
24 25 26 |
# File 'lib/reducto_ai/errors.rb', line 24 def body @body end |
#status ⇒ Integer? (readonly)
Returns HTTP status code.
21 22 23 |
# File 'lib/reducto_ai/errors.rb', line 21 def status @status end |