Exception: LittleGhost::Providers::Bedrock::StreamError

Inherits:
LittleGhost::ProviderError show all
Defined in:
lib/little_ghost/providers/bedrock.rb

Overview

Represents an error event returned inside a Bedrock stream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, event_type:) ⇒ StreamError

Creates a stream error for event_type.



51
52
53
54
# File 'lib/little_ghost/providers/bedrock.rb', line 51

def initialize(message, event_type:)
  @event_type = event_type.to_s
  super(message)
end

Instance Attribute Details

#event_typeObject (readonly)

Normalized Bedrock event type used to decide whether a retry is safe.



48
49
50
# File 'lib/little_ghost/providers/bedrock.rb', line 48

def event_type
  @event_type
end

Instance Method Details

#retryable?Boolean

Indicates whether LittleGhost may retry this Bedrock event.

Returns:

  • (Boolean)


57
# File 'lib/little_ghost/providers/bedrock.rb', line 57

def retryable? = TRANSIENT_STREAM_ERRORS.include?(event_type)