Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 20 variants Llm { provider: String, message: String, }, RateLimited { provider: String, retry_after_ms: u64, }, Tool { name: String, call_id: Option<String>, message: String, }, BadToolArgs { name: String, message: String, }, ToolRejected { name: String, reason: 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), Cancelled, Timeout { duration_ms: u64, }, Storage { message: String, }, NotFound(String), SchemaTooNew { session_id: String, found: u32, supported: u32, }, Internal { context: String, message: String, },
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Llm

LLM provider returned an error (HTTP, parse, etc.)

Fields

§provider: String
§message: String
§

RateLimited

LLM rate limited — caller should retry after retry_after_ms

Fields

§provider: String
§retry_after_ms: u64
§

Tool

Tool execution failure (spawn, timeout, I/O)

call_id links this error back to the tool_call_id of the triggering ToolCall, enabling audit logs and session persistence to correlate the failure with the exact turn that requested the tool.

Fields

§name: String
§call_id: Option<String>

The tool_call_id from the triggering ToolCall, if available.

§message: String
§

BadToolArgs

Invalid arguments passed to a tool

Fields

§name: String
§message: String
§

ToolRejected

Tool rejected execution (policy, constraints, safety)

Fields

§name: String
§reason: String
§

UnknownTool(String)

Tool not found in registry

§

PermissionDenied

Permission denied for a tool call

Fields

§name: String
§

PermissionDeniedLimit

Auto-classifier denial limit exceeded — agent should stop

Fields

§name: String
§

ProviderTruncated(String)

LLM response truncated by provider

§

Mcp

MCP protocol/transport error

Fields

§server: String
§message: String
§

Config

Configuration error (missing env var, invalid value)

Fields

§message: String
§

Io(Error)

I/O error

§

Http(Error)

HTTP client error

§

Json(Error)

JSON serialization/deserialization error

§

Cancelled

Operation cancelled via CancellationToken.

§

Timeout

Timeout after a specified duration

Fields

§duration_ms: u64
§

Storage

Storage backend error (I/O, serialization, remote storage, etc.)

Fields

§message: String
§

NotFound(String)

A named resource (team, task, etc.) was requested but does not exist.

§

SchemaTooNew

Session metadata on disk has a schema_version newer than this build of the binary knows how to interpret. Raised by SessionReader::load_meta when it sees a version greater than the supported maximum — the safe action is to refuse to load the session, not to silently drop fields.

Fields

§session_id: String
§found: u32
§supported: u32
§

Internal

Internal agent error — unexpected state that does not map to any typed variant. Prefer a specific variant; use Internal only as last resort.

Fields

§context: String
§message: String

Implementations§

Source§

impl Error

Source

pub fn is_retryable(&self) -> bool

Returns true if the error is safe to retry (rate limits, timeouts).

Source

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 Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoMaybeUndefined<T> for T

Source§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
Source§

impl<T> IntoOption<T> for T

Source§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more