Skip to Content

Error Taxonomy

The classify_error() utility maps all SDK exceptions to one of four recovery actions.

Recovery Actions

ActionMeaningCaller Behavior
RETRYTransient failureRetry with exponential backoff up to max_retries
FALLBACKService degradedSwitch to fallback model/tool/cache
ESCALATENeeds human attentionSurface to user or alert ops
ABORTPermanent failureStop execution, return error

Classification Table

RETRY

Exceptionmax_retriesWhen
ISATimeoutError3API request exceeded timeout
ISAConnectionError3Service unreachable
RateLimitError5API rate limit hit
ToolExecutionError2Tool returned transient error
asyncio.TimeoutError3Python-level timeout
ConnectionError3Built-in connection failure
OSError3Network/IO error

FALLBACK

ExceptionFallback TargetWhen
CircuitBreakerErrorAlternative service/modelCircuit breaker is open
MCPConnectionErrorLocal tool cacheMCP server down
ModelErrorCheaper/local modelModel API error

ESCALATE

ExceptionWhoWhen
HILDeniedErrorUserPermission request denied
HILTimeoutErrorUserNo response in time
ISAPermissionErrorOperatorInsufficient permissions
Unknown exceptionsOperatorUnclassified errors

ABORT

ExceptionWhen
SessionNotFoundErrorSession doesn’t exist
SessionExpiredErrorSession TTL passed
MaxIterationsErrorToo many reasoning loops
SchemaErrorJSON schema validation failed
DAGValidationErrorCircular dependency or malformed DAG
ConfigurationErrorISAAgentOptions misconfigured
ISAValidationErrorGeneric input validation failure

Usage

from isa_agent_sdk.core.resilience import classify_error, RecoveryAction try: result = await model_client.call_model(messages) except Exception as exc: ctx = classify_error(exc, service_name="model", operation="call_model") print(ctx.format_log_line()) # error_type=ModelError | service=model | operation=call_model | recovery=fallback

Structured Logging

ErrorContext.format_log_line() produces pipe-delimited structured logs:

error_type=ISATimeoutError | service=model | operation=call_model | recovery=retry | duration_ms=30001.2 | retry_attempt=1