Skip to main content

Module error

Module error 

Source
Expand description

The SDK’s error types.

Each error is a struct with its own message text. Error wraps them, one variant per type, so callers can branch with match and still reach the type’s fields.

Structs§

ContextWindowOverflowError
The combined input exceeded the model’s context window (ContextWindowOverflowError).
DefaultNotConfiguredError
A default value was read before one was configured (DefaultNotConfiguredError).
JsonValidationError
A value contains data that cannot be serialized to JSON (JsonValidationError).
MaxTokensError
The model stopped because it reached its output token limit (MaxTokensError).
ModelError
A model provider failed (ModelError), the base of the model error family.
ModelNetworkError
The network connection to the model provider failed (ModelNetworkError).
ModelThrottledError
The provider throttled or rate limited the request (ModelThrottledError).
SandboxAbortError
Sandbox execution was aborted through its cancel signal (SandboxAbortError).
SandboxIsADirectoryError
A sandbox path is a directory where a file was expected (SandboxIsADirectoryError, code EISDIR).
SandboxPathNotFoundError
A sandbox path does not exist (SandboxPathNotFoundError, code ENOENT).
SandboxPermissionError
A sandbox file, or a directory above it, is not accessible (SandboxPermissionError, code EACCES).
SandboxTimeoutError
Sandbox execution exceeded its timeout (SandboxTimeoutError).
SessionError
A session operation failed (SessionError), such as reading or restoring session data.
StorageError
A storage operation failed (StorageError), whatever the backend.
StructuredOutputError
The model failed to produce structured output (StructuredOutputError).
ToolNotFoundError
No registered tool matches the requested name (ToolNotFoundError).
ToolValidationError
A tool failed validation during registration (ToolValidationError).

Enums§

Error
Every error the SDK returns.

Type Aliases§

BoxError
A boxed, thread-safe error used as the source of wrapping errors.
Result
Result with Error as the default error type.