Exception: LittleGhost::Providers::Bedrock::StreamError
- Inherits:
-
LittleGhost::ProviderError
- Object
- StandardError
- Error
- LittleGhost::ProviderError
- LittleGhost::Providers::Bedrock::StreamError
- Defined in:
- lib/little_ghost/providers/bedrock.rb
Overview
Represents an error event returned inside a Bedrock stream.
Instance Attribute Summary collapse
-
#event_type ⇒ Object
readonly
Normalized Bedrock event type used to decide whether a retry is safe.
Instance Method Summary collapse
-
#initialize(message, event_type:) ⇒ StreamError
constructor
Creates a stream error for
event_type. -
#retryable? ⇒ Boolean
Indicates whether LittleGhost may retry this Bedrock event.
Constructor Details
#initialize(message, event_type:) ⇒ StreamError
Creates a stream error for event_type.
43 44 45 46 |
# File 'lib/little_ghost/providers/bedrock.rb', line 43 def initialize(, event_type:) @event_type = event_type.to_s super() end |
Instance Attribute Details
#event_type ⇒ Object (readonly)
Normalized Bedrock event type used to decide whether a retry is safe.
40 41 42 |
# File 'lib/little_ghost/providers/bedrock.rb', line 40 def event_type @event_type end |
Instance Method Details
#retryable? ⇒ Boolean
Indicates whether LittleGhost may retry this Bedrock event.
49 |
# File 'lib/little_ghost/providers/bedrock.rb', line 49 def retryable? = TRANSIENT_STREAM_ERRORS.include?(event_type) |