org.llm4s.error
Members list
Type members
Classlikes
API errors for external service calls
API errors for external service calls
Attributes
- Companion
- object
- Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Assistant-specific error types with rich context and formatting
Assistant-specific error types with rich context and formatting
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class CommandParseErrorclass DisplayErrorclass EOFErrorclass FileErrorclass IOErrorclass SerializationErrorclass SessionErrorShow all
Attributes
- Companion
- class
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
AssistantError.type
Authentication-related errors
Authentication-related errors
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
AuthenticationError.type
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ConfigurationError.type
Context management related errors for token windows and conversation handling
Context management related errors for token windows and conversation handling
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ContextError.type
Advanced pattern matching for error recovery and intelligent retry logic.
Advanced pattern matching for error recovery and intelligent retry logic.
Uses Scala's powerful pattern matching to implement sophisticated error handling strategies with type-safe recovery patterns.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ErrorRecovery.type
Execution errors that might succeed on retry.
Execution errors that might succeed on retry.
Represents errors from command or process execution that may be transient, such as temporary resource unavailability or intermittent failures. As a RecoverableError, retry strategies can be applied.
Value parameters
- cause
-
Optional underlying exception
- context
-
Additional key-value context for debugging
- exitCode
-
Optional process exit code if applicable
- message
-
Human-readable error description
- operation
-
The operation that failed (e.g., "bash-script", "api-call")
Attributes
- Example
-
val error = ExecutionError("Command failed", "bash-script") .withExitCode(1) .withContext("command", "npm install") - Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Error for invalid input values that fail validation.
Error for invalid input values that fail validation.
Provides detailed context about which field was invalid, what value was provided, and why it was rejected. As a NonRecoverableError, the input must be corrected before retrying.
Value parameters
- field
-
The name of the field that has invalid input
- message
-
Human-readable error description
- reason
-
Explanation of why the value is invalid
- value
-
The invalid value that was provided
Attributes
- Example
-
val error = InvalidInputError("temperature", "2.5", "must be between 0 and 1") error.context // Map("field" -> "temperature", "value" -> "2.5", "reason" -> "...") - Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Factory methods for creating InvalidInputError instances.
Factory methods for creating InvalidInputError instances.
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
InvalidInputError.type
Enhanced comprehensive error hierarchy for LLM operations using ADTs.
Enhanced comprehensive error hierarchy for LLM operations using ADTs.
This replaces the simple org.llm4s.llmconnect.model.LLMError with a much more comprehensive error system.
Key improvements over legacy version:
- Structured context information
- Recovery guidance built-in - Trait-based recoverability
- Provider-agnostic design
- Rich error formatting
- Type-safe error handling
- Private case class constructors with smart constructors
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait OrchestrationErrorclass AgentTimeoutErrorclass NodeExecutionErrorclass PlanExecutionErrorclass PlanValidationErrorclass TypeMismatchErrorclass APIErrorclass AuthenticationErrorclass ConfigurationErrorclass ContextErrorclass ExecutionErrorclass InvalidInputErrorclass NetworkErrortrait NonRecoverableErrorclass NotFoundErrorclass ProcessingErrorclass SimpleErrorclass TokenizerErrorclass UnknownErrorclass ValidationErrorclass OptimisticLockFailureclass RateLimitErrortrait RecoverableErrorclass ServiceErrorclass SystemErrorclass TimeoutErrorclass EmbeddingErrorclass EvaluationErrorclass RerankErrortrait AudioIOErrorclass SaveFailedtrait WavErrorclass WavGenerationFailedclass WavSaveFailedtrait STTErrorclass EngineNotAvailableclass ProcessingFailedclass UnsupportedFormattrait TTSErrorclass EngineNotAvailableclass SynthesisFailedShow all
Network-related errors
Network-related errors
Attributes
- Companion
- object
- Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
NetworkError.type
Marker trait for errors that cannot be recovered through retries.
Marker trait for errors that cannot be recovered through retries.
Errors extending this trait indicate permanent failures that require user intervention or code changes to resolve. Examples include authentication failures, invalid input, and configuration errors.
Use pattern matching or LLMError.isRecoverable to check recoverability:
error match {
case _: RecoverableError => // Apply retry logic
case _: NonRecoverableError => // Report failure to user
}
Attributes
- See also
-
RecoverableError for errors that may succeed on retry
- Supertypes
-
trait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class AuthenticationErrorclass ConfigurationErrorclass ContextErrorclass InvalidInputErrorclass NotFoundErrorclass ProcessingErrorclass SimpleErrorclass TokenizerErrorclass UnknownErrorclass ValidationErrorShow all
Error indicating a required configuration or environment value was not found.
Error indicating a required configuration or environment value was not found.
Use this error when a required configuration key, environment variable, or resource is missing. As a NonRecoverableError, the operation cannot proceed without providing the missing value.
Value parameters
- key
-
The configuration key or identifier that was not found
- message
-
Human-readable error description
Attributes
- Example
-
val error = NotFoundError("API key not found", "OPENAI_API_KEY") error.context // Map("key" -> "OPENAI_API_KEY") - Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Error indicating a concurrent modification was detected during an optimistic update.
Error indicating a concurrent modification was detected during an optimistic update.
Returned when an update is attempted but the record has been modified by another concurrent writer since it was last read. Callers should re-read the record and retry the operation.
Value parameters
- attemptedVersion
-
The version number that was expected but not found
- memoryId
-
The ID of the memory record that was concurrently modified
- message
-
Human-readable error description
Attributes
- Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Processing errors for operations like image processing, audio processing, etc.
Processing errors for operations like image processing, audio processing, etc.
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ProcessingError.type
Rate limiting errors - typically recoverable with exponential backoff
Rate limiting errors - typically recoverable with exponential backoff
Attributes
- Companion
- object
- Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RateLimitError.type
Marker trait for errors that may succeed on retry.
Marker trait for errors that may succeed on retry.
Errors extending this trait indicate transient failures where retrying the operation with appropriate backoff strategies may succeed. Examples include rate limiting, network timeouts, and temporary service unavailability.
Use pattern matching or LLMError.isRecoverable to check recoverability:
error match {
case _: RecoverableError => // Apply retry logic
case _: NonRecoverableError => // Report failure
}
Attributes
- See also
-
NonRecoverableError for errors that cannot be recovered
ErrorRecovery for retry utilities
- Supertypes
-
trait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class APIErrorclass ExecutionErrorclass NetworkErrorclass OptimisticLockFailureclass RateLimitErrorclass ServiceErrorclass SystemErrorclass TimeoutErrorShow all
Service-level errors from LLM providers
Service-level errors from LLM providers
Attributes
- Companion
- object
- Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ServiceError.type
A simple error with just a message and no additional context.
A simple error with just a message and no additional context.
Use this error type for basic error cases where no structured context is needed. For errors with more context, prefer specific error types like ValidationError or ConfigurationError.
Value parameters
- message
-
Human-readable error description
Attributes
- Example
-
val error = SimpleError("Something went wrong") error.message // "Something went wrong" error.context // Map.empty - Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Factory methods for creating SimpleError instances.
Factory methods for creating SimpleError instances.
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
SimpleError.type
System-level errors for unexpected exceptions that may be transient.
System-level errors for unexpected exceptions that may be transient.
Represents unexpected system failures such as resource exhaustion, temporary unavailability, or other transient issues. As a RecoverableError, these can be retried with appropriate backoff strategies.
Value parameters
- cause
-
Optional underlying exception
- message
-
Human-readable error description
Attributes
- Example
-
val error = SystemError("Unexpected memory allocation failure", Some(cause)) error.context // Map("exceptionType" -> "OutOfMemoryError") - Companion
- object
- Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Factory methods for creating SystemError instances.
Factory methods for creating SystemError instances.
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
SystemError.type
Extension methods for converting Throwable to domain-specific LLMError types.
Extension methods for converting Throwable to domain-specific LLMError types.
Provides a uniform way to convert exceptions into the LLM4S error hierarchy, enabling consistent error handling across the codebase.
Attributes
- Example
-
import org.llm4s.error.ThrowableOps._ val error = new java.net.SocketTimeoutException("timeout").toLLMError // Returns NetworkError("Request timeout", ...) // With custom mapper implicit val mapper: ErrorMapper = customMapper val customError = exception.toLLMError - Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ThrowableOps.type
Timeout errors that can potentially succeed with a different timeout or retry.
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") - Supertypes
-
trait RecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Tokenizer-related errors for context management
Tokenizer-related errors for context management
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
TokenizerError.type
Unknown/unexpected errors with full exception context
Unknown/unexpected errors with full exception context
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
UnknownError.type
Validation errors for malformed requests
Validation errors for malformed requests
Attributes
- Companion
- object
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ValidationError.type