pub enum ErrorCategory {
Show 16 variants
Network,
Timeout,
RateLimit,
ServiceUnavailable,
CircuitOpen,
Authentication,
InvalidParameters,
ToolNotFound,
ResourceNotFound,
PermissionDenied,
PolicyViolation,
PlanModeViolation,
SandboxFailure,
ResourceExhausted,
Cancelled,
ExecutionError,
}Expand description
Canonical error category used throughout VT Code for consistent retry decisions, user-facing messages, and error handling strategies.
Variants§
Network
Network connectivity issue (connection reset, DNS failure, etc.)
Timeout
Request timed out or deadline exceeded
RateLimit
Rate limit exceeded (HTTP 429, provider throttling)
External service temporarily unavailable (HTTP 5xx)
CircuitOpen
Circuit breaker is open for this tool/service
Authentication
Authentication or authorization failure (invalid API key, expired token)
InvalidParameters
Invalid parameters, arguments, or schema validation failure
ToolNotFound
Tool not found or unavailable
ResourceNotFound
Resource not found (file, directory, path does not exist)
PermissionDenied
OS-level permission denied (file permissions, EACCES, EPERM)
PolicyViolation
Policy violation (workspace boundary, tool deny policy, safety gate)
PlanModeViolation
Plan mode violation (mutating tool in read-only mode)
SandboxFailure
Sandbox execution failure
ResourceExhausted
Resource exhausted (quota, billing, spending limit, disk, memory)
Cancelled
User cancelled the operation
ExecutionError
General execution error (catch-all for unclassified failures)
Implementations§
Source§impl ErrorCategory
impl ErrorCategory
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Whether this error category is safe to retry.
Sourcepub const fn is_llm_mistake(&self) -> bool
pub const fn is_llm_mistake(&self) -> bool
Whether this error is an LLM argument mistake (should not count toward circuit breaker thresholds).
Sourcepub const fn is_permanent(&self) -> bool
pub const fn is_permanent(&self) -> bool
Whether this error represents a permanent, non-recoverable condition.
Sourcepub fn retryability(&self) -> Retryability
pub fn retryability(&self) -> Retryability
Get the recommended retryability for this error category.
Sourcepub fn recovery_suggestions(&self) -> Vec<Cow<'static, str>>
pub fn recovery_suggestions(&self) -> Vec<Cow<'static, str>>
Get recovery suggestions for this error category. Returns static strings to avoid allocation.
Sourcepub const fn user_label(&self) -> &'static str
pub const fn user_label(&self) -> &'static str
Get a concise, user-friendly label for this error category.
Trait Implementations§
Source§impl Clone for ErrorCategory
impl Clone for ErrorCategory
Source§fn clone(&self) -> ErrorCategory
fn clone(&self) -> ErrorCategory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ErrorCategory
impl Debug for ErrorCategory
Source§impl<'de> Deserialize<'de> for ErrorCategory
impl<'de> Deserialize<'de> for ErrorCategory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ErrorCategory
impl Display for ErrorCategory
Source§impl From<&LLMError> for ErrorCategory
impl From<&LLMError> for ErrorCategory
Source§impl Hash for ErrorCategory
impl Hash for ErrorCategory
Source§impl PartialEq for ErrorCategory
impl PartialEq for ErrorCategory
Source§impl Serialize for ErrorCategory
impl Serialize for ErrorCategory
impl Copy for ErrorCategory
impl Eq for ErrorCategory
impl StructuralPartialEq for ErrorCategory
Auto Trait Implementations§
impl Freeze for ErrorCategory
impl RefUnwindSafe for ErrorCategory
impl Send for ErrorCategory
impl Sync for ErrorCategory
impl Unpin for ErrorCategory
impl UnsafeUnpin for ErrorCategory
impl UnwindSafe for ErrorCategory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.