Exception: OpenAI::Errors::WebSocketConnectionError Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Base class for SDK WebSocket connection failures.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, message: nil, cause: nil, http_status: nil) ⇒ WebSocketConnectionError

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 WebSocketConnectionError.



14
15
16
17
18
19
# File 'lib/openai/helpers/websocket/errors.rb', line 14

def initialize(url:, message: nil, cause: nil, http_status: nil)
  @url = sanitized_error_url(url)
  @cause = cause
  @http_status = http_status
  super(message || default_message)
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)


9
10
11
# File 'lib/openai/helpers/websocket/errors.rb', line 9

def http_status
  @http_status
end

#urlURI::Generic (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:

  • (URI::Generic)


9
10
11
# File 'lib/openai/helpers/websocket/errors.rb', line 9

def url
  @url
end

Instance Method Details

#causeException?

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:

  • (Exception, nil)


11
# File 'lib/openai/helpers/websocket/errors.rb', line 11

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