Error Codes

Reference for Clawdius error types and their meanings.

Core Error Type

The clawdius_core::Error enum is the top-level error type. It is defined in crates/clawdius-core/src/error/mod.rs.

Error Variants

Configuration

VariantMessage TemplateRetryableDescription
Config(msg)Configuration error: {msg}NoInvalid or missing configuration

LLM

VariantMessage TemplateRetryableDescription
Llm(msg)LLM error: {msg}NoGeneral LLM failure
LlmProvider { message, provider }LLM provider error from {provider}: {message}NoProvider-specific error
RateLimited { retry_after_ms }Rate limited. Retry after {retry_after_ms}msYesHTTP 429 rate limit
ContextLimit { current, limit }Context limit exceeded: {current}/{limit} tokensNoToken budget exceeded
RetryExhausted(n)Retry exhausted after {n} attemptsNoAll retries failed
CircuitBreakerOpen { service, last_error }Circuit breaker open for {service}YesService circuit open
QuotaExceeded(msg)Quota exceeded: {msg}NoAPI quota limit reached

Tool Execution

VariantMessage TemplateRetryableDescription
ToolExecution { tool, reason }Tool execution failed '{tool}': {reason}NoTool failed
Tool(msg)Tool error: {msg}NoTool configuration error
Sandbox(msg)Sandbox error: {msg}NoSandbox violation

Session

VariantMessage TemplateRetryableDescription
Session(msg)Session error: {msg}NoGeneral session error
SessionNotFound { id }Session not found: {id}NoInvalid session ID

I/O and Serialization

VariantMessage TemplateRetryableDescription
Io(err)IO error: {err}NoFile system error
Serialization(err)Serialization error: {err}NoJSON error
TomlDe(err)TOML deserialization error: {err}NoConfig parse error
TomlSer(err)TOML serialization error: {err}NoConfig write error
Database(err)Database error: {err}NoSQLite error
Network(msg)Network error: {msg}NoNetwork failure

System

VariantMessage TemplateRetryableDescription
Timeout(duration)Operation timed out after {duration:?}YesOperation timeout
CancelledOperation cancelledNoUser cancelled
Internal(msg)Internal error: {msg}NoBug in Clawdius
NotFound(msg)Not found: {msg}NoResource not found
InvalidInput(msg)Invalid input: {msg}NoBad user input
ParseError(msg)Parse error: {msg}NoParse failure
UnsupportedLanguage(msg)Unsupported language: {msg}NoLanguage not supported

Additional

VariantMessage TemplateRetryableDescription
Auth(msg)Authentication error: {msg}NoAuth failure
Checkpoint(msg)Checkpoint error: {msg}NoCheckpoint failure
Brain(msg)Brain runtime error: {msg}NoWASM runtime error
Rpc(msg)RPC error: {msg}NoJSON-RPC error
Model(msg)Model error: {msg}NoModel loading error
Processing(msg)Processing error: {msg}NoData processing error
Sprint(msg)Sprint error: {msg}NoSprint execution error

Error Helper Methods

#![allow(unused)]
fn main() {
use clawdius_core::Error;

let error = Error::RateLimited { retry_after_ms: 5000 };

error.is_retryable();       // true
error.retry_after_ms();      // Some(5000)
error.is_rate_limited();     // true
error.is_timeout();          // false
error.is_circuit_breaker();  // false
error.user_message();        // Human-friendly message
}

Retry Logic

Errors are retryable when is_retryable() returns true. The retry system uses exponential backoff:

delay = min(initial_delay * base^attempt + jitter, max_delay)

Default values: initial_delay = 1000ms, base = 2.0, max_delay = 30000ms.

Enhanced Errors

The EnhancedError type provides rich, actionable error messages with context, suggestions, and documentation links:

#![allow(unused)]
fn main() {
use clawdius_core::error::ErrorHelpers;

let error = ErrorHelpers::file_not_found("/path/to/file");
println!("{}", error.format_pretty());
}