Exception: OpenAI::Errors::RealtimeConnectionError

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 cannot be opened or used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, message: nil, cause: nil, http_status: nil) ⇒ 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.



26
27
28
29
30
31
# File 'lib/openai/helpers/realtime/errors.rb', line 26

def initialize(url:, message: nil, cause: nil, http_status: nil)
  @url = sanitized_error_url(url)
  @cause = cause
  @http_status = http_status
  super(message || "Realtime WebSocket connection error.")
end

Instance Attribute Details

#http_statusInteger? (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.

Returns:

  • (Integer, nil)


15
16
17
# File 'lib/openai/helpers/realtime/errors.rb', line 15

def http_status
  @http_status
end

#urlURI::Generic (readonly)

Returns:

  • (URI::Generic)


8
9
10
# File 'lib/openai/helpers/realtime/errors.rb', line 8

def url
  @url
end

Instance Method Details

#causeException?

Returns:

  • (Exception, nil)


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

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