Exception: OpenAI::Errors::RealtimeProtocolError

Inherits:
Error
  • Object
show all
Defined in:
lib/openai/helpers/realtime/errors.rb,
sig/openai/helpers/realtime/extensions.rbs

Overview

Raised when a Realtime WebSocket message cannot be parsed as a typed event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, cause: nil) ⇒ RealtimeProtocolError

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.

Returns a new instance of RealtimeProtocolError.

Parameters:

  • data: (String)
  • cause: (StandardError, nil) (defaults to: nil)


66
67
68
69
70
# File 'lib/openai/helpers/realtime/errors.rb', line 66

def initialize(data:, cause: nil)
  @data = data
  @cause = cause
  super("Invalid Realtime WebSocket event.")
end

Instance Attribute Details

#dataString (readonly)

Returns:

  • (String)


57
58
59
# File 'lib/openai/helpers/realtime/errors.rb', line 57

def data
  @data
end

Instance Method Details

#causeStandardError?

Returns:

  • (StandardError, nil)


60
# File 'lib/openai/helpers/realtime/errors.rb', line 60

def cause = @cause.nil? ? super : @cause