Exception: OpenAI::Errors::PollingTimeoutError

Inherits:
PollingError show all
Defined in:
lib/openai/errors.rb,
sig/openai/errors.rbs

Overview

Raised when a polling helper exceeds its overall timeout.

Instance Attribute Summary collapse

Attributes inherited from Error

#cause

Instance Method Summary collapse

Constructor Details

#initialize(operation:, timeout:, resource:) ⇒ PollingTimeoutError

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

Parameters:

  • operation (String)
  • timeout (Float)
  • resource (Object, nil)
  • operation: (String)
  • timeout: (Float)
  • resource: (top)


41
42
43
44
45
46
# File 'lib/openai/errors.rb', line 41

def initialize(operation:, timeout:, resource:)
  @operation = operation
  @timeout = timeout
  @resource = resource
  super("Timed out waiting for #{operation} after #{timeout} seconds.")
end

Instance Attribute Details

#operationString (readonly)

A human-readable description of the operation being polled.

Returns:

  • (String)


34
35
36
# File 'lib/openai/errors.rb', line 34

def operation
  @operation
end

#resourceObject? (readonly)

The last resource returned by the API before the timeout, or nil when the deadline elapsed before the first response.

Returns:

  • (Object, nil)


24
25
26
# File 'lib/openai/errors.rb', line 24

def resource
  @resource
end

#timeoutFloat (readonly)

The configured overall polling timeout in seconds.

Returns:

  • (Float)


29
30
31
# File 'lib/openai/errors.rb', line 29

def timeout
  @timeout
end