pub enum ToolErrorCategory {
ToolNotFound,
InvalidParameters,
TypeMismatch,
PolicyBlocked,
ConfirmationRequired,
PermanentFailure,
Cancelled,
RateLimited,
ServerError,
NetworkError,
Timeout,
}Expand description
Fine-grained 12-category classification of tool invocation errors.
Each category determines retry eligibility, LLM parameter reformat path, quality attribution for reputation scoring, and structured feedback content.
§Examples
use zeph_common::error_taxonomy::ToolErrorCategory;
assert!(ToolErrorCategory::RateLimited.is_retryable());
assert!(!ToolErrorCategory::InvalidParameters.is_retryable());Variants§
ToolNotFound
Tool name not found in the registry (LLM requested a non-existent tool).
InvalidParameters
LLM provided invalid or missing parameters for the tool.
TypeMismatch
Parameter type mismatch (e.g., string where integer expected).
PolicyBlocked
Blocked by security policy (blocklist, sandbox, trust gate).
ConfirmationRequired
Requires user confirmation before execution.
PermanentFailure
HTTP 403/404 or equivalent permanent resource rejection.
Cancelled
Operation cancelled by the user.
RateLimited
HTTP 429 (rate limit) or resource exhaustion.
ServerError
HTTP 5xx or equivalent server-side error.
NetworkError
Network connectivity failure (DNS, connection refused, reset).
Timeout
Operation timed out.
Implementations§
Source§impl ToolErrorCategory
impl ToolErrorCategory
Sourcepub fn is_retryable(self) -> bool
pub fn is_retryable(self) -> bool
Whether this error category is eligible for automatic retry with backoff.
Sourcepub fn needs_parameter_reformat(self) -> bool
pub fn needs_parameter_reformat(self) -> bool
Whether the LLM should be asked to reformat parameters and retry.
Only InvalidParameters and TypeMismatch trigger the reformat path.
Sourcepub fn is_quality_failure(self) -> bool
pub fn is_quality_failure(self) -> bool
Whether this error is attributable to LLM output quality.
Infrastructure errors (network, timeout, server, rate limit) are NOT the model’s fault and must never trigger self-reflection.
Sourcepub fn domain(self) -> ErrorDomain
pub fn domain(self) -> ErrorDomain
Map to the high-level error domain for recovery dispatch.
Sourcepub fn label(self) -> &'static str
pub fn label(self) -> &'static str
Human-readable label for audit logs, TUI status indicators, and structured feedback.
Sourcepub fn phase(self) -> ToolInvocationPhase
pub fn phase(self) -> ToolInvocationPhase
Map to the diagnostic invocation phase per arXiv:2601.16280.
Sourcepub fn suggestion(self) -> &'static str
pub fn suggestion(self) -> &'static str
Recovery suggestion for the LLM based on error category.
Trait Implementations§
Source§impl Clone for ToolErrorCategory
impl Clone for ToolErrorCategory
Source§fn clone(&self) -> ToolErrorCategory
fn clone(&self) -> ToolErrorCategory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolErrorCategory
impl Debug for ToolErrorCategory
Source§impl Hash for ToolErrorCategory
impl Hash for ToolErrorCategory
Source§impl PartialEq for ToolErrorCategory
impl PartialEq for ToolErrorCategory
Source§impl Serialize for ToolErrorCategory
impl Serialize for ToolErrorCategory
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToolErrorCategoryExt for ToolErrorCategory
impl ToolErrorCategoryExt for ToolErrorCategory
Source§fn error_kind(self) -> ErrorKind
fn error_kind(self) -> ErrorKind
ErrorKind.