errors • AI Agent SDK
Structured exception hierarchy for PraisonAI SDK.
errors
AI Agent
Structured exception hierarchy for PraisonAI SDK.
Provides uniform error semantics for consistent handling across:
- Multi-agent orchestration
- Tool execution
- LLM interactions
- Memory operations
- External integrations
Import
from praisonaiagents import errorsClasses
Discriminated struct for retry and failover decisions.
IdleTimeoutBreakerCircuit breaker for consecutive idle-timeout failures.
ErrorContextProtocolProtocol for structured error context propagation.
PraisonAIErrorBase error class with structured context for PraisonAI SDK.
ToolExecutionErrorTool execution failed.
LLMErrorLLM interaction failed.
BudgetExceededErrorBudget limits exceeded (tokens, time, etc).
ValidationErrorInput validation failed.
NetworkErrorNetwork/external service error.
HandoffErrorAgent handoff/delegation failed.
PraisonAIConfigErrorConfiguration error (missing API keys, invalid settings, etc).
HandoffCycleErrorCircular handoff dependency detected.
HandoffDepthErrorMaximum handoff depth exceeded.
HandoffTimeoutErrorHandoff operation timed out.
HandoffValidationErrorRaised when a typed handoff payload does not satisfy the declared schema.
Constants
| Name | Value |
|---|---|
LEGACY_ERROR_CATEGORY_MAP | {'tool': 'unknown', 'llm': 'unknown', 'budget': 'billing', 'validation': 'format_error', 'network': 'unknown', 'handoff': 'unknown'} |