Class: LLM::Bedrock::ErrorHandler Private
- Inherits:
-
Object
- Object
- LLM::Bedrock::ErrorHandler
- Defined in:
- lib/llm/providers/bedrock/error_handler.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handles Bedrock API error responses.
Bedrock errors come as JSON with:
{ "message" => "...", "__type" => "..." }
or as standard HTTP status codes.
Instance Attribute Summary collapse
- #res ⇒ Net::HTTPResponse readonly private
- #span ⇒ Object? readonly private
Instance Method Summary collapse
- #initialize(tracer, span, res) ⇒ LLM::Bedrock::ErrorHandler constructor private
- #raise_error! ⇒ Object private
Constructor Details
#initialize(tracer, span, res) ⇒ LLM::Bedrock::ErrorHandler
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 |
# File 'lib/llm/providers/bedrock/error_handler.rb', line 26 def initialize(tracer, span, res) @tracer = tracer @span = span @res = res end |
Instance Attribute Details
#res ⇒ Net::HTTPResponse (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/llm/providers/bedrock/error_handler.rb', line 15 def res @res end |
#span ⇒ Object? (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/llm/providers/bedrock/error_handler.rb', line 19 def span @span end |
Instance Method Details
#raise_error! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 39 |
# File 'lib/llm/providers/bedrock/error_handler.rb', line 34 def raise_error! ex = error @tracer.on_request_error(ex:, span:) ensure raise(ex) if ex end |