Skip to main content

Module error_handling

Module error_handling 

Source
Expand description

Unified error handling module

Provides comprehensive error handling including error recording, timeout handling, and retry mechanisms. Unified Error Handling Module

This module provides comprehensive error handling for agent execution, including error recording with context, timeout handling, retry mechanisms, and context overflow handling.

§Features

  • Error Recording: Record errors with timestamps, context, and stack traces
  • Timeout Handling: Mark agents as timed out and emit timeout events
  • Retry Mechanism: Configurable retry behavior for transient failures
  • Overflow Handling: Automatic compaction and retry on context overflow

§Requirements Coverage

  • Requirement 15.1: Error recording with context
  • Requirement 15.2: Timeout handling with events
  • Requirement 15.3: Tool call failure recording
  • Requirement 15.4: Configurable retry behavior

Structs§

AgentError
Agent error type for Result handling
ErrorContext
Context information for an error
ErrorHandler
Error handler for recording and managing errors
OverflowHandler
Handler for context length exceeded errors.
RetryHandler
Retry handler for managing retry operations
TimeoutConfig
Timeout configuration
TimeoutEvent
Timeout event emitted when timeout status changes
TimeoutHandler
Timeout handler for managing agent timeouts
UnifiedErrorRecord
Unified error record with full context
UnifiedRetryConfig
Retry configuration

Enums§

AgentErrorKind
Error kinds for categorization
RetryResult
Result of a retry operation
RetryStrategy
Retry strategy types
TimeoutStatus
Timeout status for an agent