ServiceError

org.llm4s.error.ServiceError
See theServiceError companion object
@Stable
final case class ServiceError extends LLMError, RecoverableError

Service-level errors from LLM providers

Value parameters

retryAfter

the delay the provider asked for before retrying (an HTTP Retry-After header, usually on a 503), if it gave one

Attributes

Companion
object
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 isRecoverableStatus: Boolean

Whether httpStatus is one a retry may fix: 5xx, 429 and 408 - the status check of RetryPolicy.isRetryableStatus. The error itself is always a RecoverableError; this says whether this particular status is.

Whether httpStatus is one a retry may fix: 5xx, 429 and 408 - the status check of RetryPolicy.isRetryableStatus. The error itself is always a RecoverableError; this says whether this particular status is.

Attributes

def withRetryAfter(delay: FiniteDuration): ServiceError

This error, carrying the delay the provider asked for before retrying.

This error, carrying the delay the provider asked for before retrying.

Attributes

Inherited methods

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
def maxRetries: Int

Maximum number of retry attempts recommended.

Maximum number of retry attempts recommended.

Attributes

Inherited from:
RecoverableError
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

override val code: Option[String]

Optional error code for programmatic handling

Optional error code for programmatic handling

Attributes

override val context: Map[String, String]

Additional context information

Additional context information

Attributes

override val retryDelay: Option[FiniteDuration]

The provider's retryAfter hint when it gave one, else ServiceError.DefaultRetryDelay.

The provider's retryAfter hint when it gave one, else ServiceError.DefaultRetryDelay.

Attributes