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.



43
44
45
46
# File 'lib/little_ghost/providers/bedrock.rb', line 43

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.



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.

Returns:

  • (Boolean)


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

def retryable? = TRANSIENT_STREAM_ERRORS.include?(event_type)