pub enum AgentError {
ConfigNotFound {
path: PathBuf,
},
ConfigInvalid {
message: String,
},
ServerConnection {
url: String,
reason: String,
},
ServerError {
message: String,
},
Provider(String),
ToolExecution {
tool: String,
reason: String,
},
Io {
context: String,
source: Error,
},
SessionNotFound {
id: String,
},
Unexpected(String),
}Expand description
Errors that can occur in the Agent system
This enum covers all error cases across the agent:
- Configuration errors
- Server/network errors
- Provider (LLM) errors
- Tool execution errors
- I/O errors
Variants§
ConfigNotFound
Configuration file not found at the specified path
ConfigInvalid
Configuration file exists but is invalid
ServerConnection
Failed to establish connection to server
ServerError
Server returned an error response
Provider(String)
Error from an LLM provider (Anthropic, OpenAI, etc.)
ToolExecution
A tool failed to execute
Io
I/O operation failed with context
SessionNotFound
Session not found
Unexpected(String)
An unexpected error occurred
Implementations§
Trait Implementations§
Source§impl Debug for AgentError
impl Debug for AgentError
Source§impl Display for AgentError
impl Display for AgentError
Source§impl Error for AgentError
impl Error for AgentError
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 !RefUnwindSafe for AgentError
impl !UnwindSafe for AgentError
impl Freeze for AgentError
impl Send for AgentError
impl Sync for AgentError
impl Unpin for AgentError
impl UnsafeUnpin for AgentError
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