motosan_agent_loop/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum AgentError {
6 #[error("llm error: {0}")]
8 Llm(String),
9
10 #[error("tool error: {0}")]
12 Tool(String),
13
14 #[error("serde error: {0}")]
16 Serde(#[from] serde_json::Error),
17
18 #[error("io error: {0}")]
20 Io(#[from] std::io::Error),
21
22 #[error("max iterations ({0}) exceeded")]
24 MaxIterations(usize),
25
26 #[cfg(feature = "cancellation")]
28 #[error("cancelled")]
29 Cancelled,
30
31 #[cfg(feature = "mcp-client")]
33 #[error("mcp error: {0}")]
34 Mcp(String),
35}
36
37pub type Result<T> = std::result::Result<T, AgentError>;