#[non_exhaustive]pub enum Error {
Show 13 variants
InvalidAgent(String),
UnknownDriver(String),
MaxIterations(usize),
Cancelled,
Sealed(SealReason),
HookBlocked {
reason: String,
user_message: Option<String>,
},
Driver {
kind: LlmErrorKind,
message: String,
},
Mcp(String),
EventLog(String),
EventConflict {
expected: u64,
actual: u64,
},
Io(Error),
Json(Error),
Other(String),
}Expand description
Errors surfaced by agentyk.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidAgent(String)
The agent was composed without a model, or is otherwise invalid.
UnknownDriver(String)
No driver registered for the model’s DriverId.
MaxIterations(usize)
A turn hit the iteration ceiling without producing a final response.
Cancelled
The turn was cancelled via a crate::cancellation::CancellationToken.
Sealed(SealReason)
The turn was deliberately sealed — see crate::turn::SealReason.
HookBlocked
A blockable user hook refused the prompt or tool action.
Fields
Driver
An LLM driver failed. kind classifies whether retrying is worth it
— see Error::is_retryable.
Fields
kind: LlmErrorKindWhether retrying is worth it.
Mcp(String)
An MCP server or transport failed.
EventLog(String)
The event log failed to append or read.
EventConflict
An append expected a different end-of-stream sequence.
Io(Error)
Local I/O failed — an event log file, a workspace read.
Json(Error)
Serialization or deserialization failed.
Other(String)
Anything without a more specific variant.
Implementations§
Source§impl Error
impl Error
Sourcepub fn driver(kind: LlmErrorKind, message: impl Into<String>) -> Error
pub fn driver(kind: LlmErrorKind, message: impl Into<String>) -> Error
Shorthand for Error::Driver { kind, message: message.into() }.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether a host should consider retrying the operation that produced
this error. Only Error::Driver carries enough information to say
yes; every other variant is a local/config problem retrying can’t fix.
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()