TimeoutError

org.llm4s.error.TimeoutError
final case class TimeoutError(message: String, timeoutDuration: Duration, operation: String, cause: Option[Throwable], context: Map[String, String]) extends LLMError

Timeout errors that can potentially succeed with a different timeout or retry.

Represents operations that exceeded their time limit. As a RecoverableError, these can be retried with longer timeouts or exponential backoff strategies.

Value parameters

cause

Optional underlying exception

context

Additional key-value context for debugging

message

Human-readable error description

operation

The operation that timed out (e.g., "api-call", "completion")

timeoutDuration

The timeout duration that was exceeded

Attributes

Example
import scala.concurrent.duration._
val error = TimeoutError("Request timed out", 30.seconds, "api-call")
 .withContext("endpoint", "https://api.openai.com")
Graph
Supertypes
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def withContext(key: String, value: String): TimeoutError

Adds a single key-value pair to the error context.

Adds a single key-value pair to the error context.

Attributes

def withContext(entries: Map[String, String]): TimeoutError

Adds multiple key-value pairs to the error context.

Adds multiple key-value pairs to the error context.

Attributes

def withOperation(op: String): TimeoutError

Updates the operation and adds it to the context.

Updates the operation and adds it to the context.

Attributes

Inherited methods

def code: Option[String]

Optional error code for programmatic handling

Optional error code for programmatic handling

Attributes

Inherited from:
LLMError
def correlationId: Option[String]

Error correlation IDs for debugging

Error correlation IDs for debugging

Attributes

Inherited from:
LLMError
def formatted: String

Formatted error message with context

Formatted error message with context

Attributes

Inherited from:
LLMError
final override def isRecoverable: Boolean

DEPRECATED: Use type-level markers instead

DEPRECATED: Use type-level markers instead

Attributes

Definition Classes
RecoverableError -> LLMError
Inherited from:
RecoverableError (hidden)
def maxRetries: Int

Maximum number of retry attempts recommended.

Maximum number of retry attempts recommended.

Attributes

Inherited from:
RecoverableError (hidden)
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def retryDelay: Option[Long]

Suggested delay in milliseconds before retrying.

Suggested delay in milliseconds before retrying.

Attributes

Inherited from:
RecoverableError (hidden)