Skip to main content

Module error_category

Module error_category 

Source
Expand description

Unified error categorization system for consistent error classification across VT Code.

This module provides a single canonical ErrorCategory enum that unifies the previously separate classification systems in registry::error (8-variant ToolErrorType) and unified_error (16-variant UnifiedErrorKind). Both systems now map through this shared taxonomy for consistent retry decisions and error handling.

§Error Categories

Errors are divided into retryable (transient) and non-retryable (permanent) categories, with sub-classifications for specific handling strategies.

§Design Decisions

  • String-based fallback is preserved only for anyhow::Error chains where the original type is erased. Typed From conversions are preferred.
  • Policy violations are explicitly separated from OS-level permission denials.
  • Rate limiting is a distinct category (not merged with network errors).
  • Circuit breaker open is categorized separately for recovery flow routing.

Enums§

BackoffStrategy
Backoff strategy for retryable errors.
ErrorCategory
Canonical error category used throughout VT Code for consistent retry decisions, user-facing messages, and error handling strategies.
Retryability
Describes whether and how an error can be retried.

Functions§

classify_anyhow_error
Classify an anyhow::Error into a canonical ErrorCategory.
classify_error_message
Classify an error message string into an ErrorCategory.
is_retryable_llm_error_message
Check if an LLM error message is retryable (used by the LLM request retry loop).