org.llm4s.error
Members list
Type members
Classlikes
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
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
AuthenticationError.type
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ConfigurationError.type
Context management related errors for token windows and conversation handling
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 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 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 NetworkErrorclass NotFoundErrorclass ProcessingErrorclass RateLimitErrorclass ServiceErrorclass SimpleErrorclass SystemErrorclass TimeoutErrorclass TokenizerErrorclass UnknownErrorclass ValidationErrorclass EmbeddingErrorclass EvaluationErrorclass RerankErrortrait AudioIOErrorclass SaveFailedtrait WavErrorclass WavGenerationFailedclass WavSaveFailedtrait STTErrorclass EngineNotAvailableclass ProcessingFailedclass UnsupportedFormattrait TTSErrorclass EngineNotAvailableclass SynthesisFailedShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
NetworkError.type
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 LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Processing errors for operations like image processing, audio processing, etc.
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ProcessingError.type
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RateLimitError.type
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
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
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 LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
TokenizerError.type
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
UnknownError.type
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ValidationError.type