Exception: RubyLLM::Error
- Inherits:
-
StandardError
- Object
- StandardError
- RubyLLM::Error
- Defined in:
- lib/ruby_llm/error.rb,
lib/ruby_llm.rb
Overview
Custom error class that wraps API errors from different providers into a consistent format with helpful error messages.
Direct Known Subclasses
BadRequestError, ForbiddenError, OverloadedError, PaymentRequiredError, RateLimitError, ServerError, ServiceUnavailableError, UnauthorizedError
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response = nil, message = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response = nil, message = nil) ⇒ Error
Returns a new instance of Error.
9 10 11 12 |
# File 'lib/ruby_llm/error.rb', line 9 def initialize(response = nil, = nil) @response = response super( || response&.body) end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/ruby_llm/error.rb', line 7 def response @response end |