pub enum Error {
Show 16 variants
Llm {
provider: String,
message: String,
},
RateLimited {
provider: String,
retry_after_ms: u64,
},
Tool {
name: String,
message: String,
},
BadToolArgs {
name: String,
message: String,
},
UnknownTool(String),
PermissionDenied {
name: String,
reason: DecisionReason,
},
PermissionDeniedLimit {
name: String,
},
ProviderTruncated(String),
Mcp {
server: String,
message: String,
},
Config {
message: String,
},
Io(Error),
Http(Error),
Json(Error),
Timeout {
duration_ms: u64,
},
Storage {
message: String,
},
Other(String),
}Variants§
Llm
LLM provider returned an error (HTTP, parse, etc.)
RateLimited
LLM rate limited — caller should retry after retry_after_ms
Tool
Tool execution failure (spawn, timeout, I/O)
BadToolArgs
Invalid arguments passed to a tool
UnknownTool(String)
Tool not found in registry
PermissionDenied
Permission denied for a tool call
PermissionDeniedLimit
Auto-classifier denial limit exceeded — agent should stop
ProviderTruncated(String)
LLM response truncated by provider
Mcp
MCP protocol/transport error
Config
Configuration error (missing env var, invalid value)
Io(Error)
I/O error
Http(Error)
HTTP client error
Json(Error)
JSON serialization/deserialization error
Timeout
Timeout after a specified duration
Storage
Storage backend error (I/O, serialization, remote storage, etc.)
Other(String)
Catch-all for errors that don’t fit elsewhere
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if the error is safe to retry (rate limits, timeouts).
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true if the error is transient (network issues, timeouts).
Transient errors may resolve without changing the request.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more