LLM failures are now raised as structuredDocumentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
LLMError exceptions instead of returning None, enabling proper error handling and retry policies.
Quick Start
How It Works
| Component | Purpose |
|---|---|
| LLMError | Structured exception with retry classification |
| on_error Hook | Intercept errors before propagation |
| is_retryable | Boolean flag for orchestration decisions |
| Context Overflow | Recursive depth limit of 2 |
Error Classification
LLM errors are automatically classified as retryable or non-retryable based on error messages:Retryable Errors
- Rate limits:
429,rate limit,too many requests - Network issues:
timeout,connection reset,socket error - Server errors:
500,502,503,504,service unavailable - DNS/Network:
dns,network,connection refused
Non-Retryable Errors
- Authentication:
401,403,unauthorized,invalid_api_key - Client errors: Most 4xx status codes
Default Behavior
Unknown errors default tois_retryable=True for resilience.
LLMError Structure
TheLLMError class provides structured error information:
| Field | Type | Description |
|---|---|---|
message | str | Error description |
model_name | str | LLM model that failed |
agent_id | str | Agent identifier |
session_id | str | Session identifier |
is_retryable | bool | Whether error can be retried |
Context Overflow Protection
LLM context overflow triggers automatic retry with truncated messages, limited to depth 2:Migration Guide
Before (returned None):Best Practices
Use on_error for Logging
Use on_error for Logging
Implement the
on_error hook to log errors without interrupting the retry flow:Handle Authentication Separately
Handle Authentication Separately
Authentication errors are non-retryable and need immediate attention:
Monitor Error Patterns
Monitor Error Patterns
Track error patterns to identify systemic issues:
Graceful Degradation
Graceful Degradation
Use error information to implement graceful degradation:
Related
Task Retry Policy
Configure task-level retry behavior
Hooks
Agent lifecycle hooks and events

