pub enum Error {
Provider {
message: String,
status_code: Option<u16>,
},
ToolExecution {
tool_name: String,
message: String,
},
Memory(String),
Config(String),
Runtime(String),
Serialization(Error),
Io(Error),
}Expand description
Errors that can occur during agent operation.
Variants§
Provider
Error from the LLM provider.
Fields
ToolExecution
Error during tool execution.
Fields
Memory(String)
Error from the memory system.
Config(String)
Configuration error (e.g., missing required fields).
Runtime(String)
Runtime error during agent loop execution.
Serialization(Error)
Serialization/deserialization error.
Io(Error)
IO error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn provider_with_status(message: impl Display, status_code: u16) -> Self
pub fn provider_with_status(message: impl Display, status_code: u16) -> Self
Create a provider error with an HTTP status code.
Sourcepub fn tool_execution(tool_name: impl Display, message: impl Display) -> Self
pub fn tool_execution(tool_name: impl Display, message: impl Display) -> Self
Create a tool execution error.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check whether this error is safe to retry.
Returns true for transient provider errors (429, 500, 502, 503, 504)
and provider errors without a status code (e.g., timeouts).
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