pub enum Error {
Show 14 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,
},
ProviderTruncated(String),
Mcp {
server: String,
message: String,
},
Config {
message: String,
},
Io(Error),
Http(Error),
Json(Error),
Timeout {
duration_ms: u64,
},
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
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
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe 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
Mutably borrows from an owned value. Read more