1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum AgentError {
5 #[error("Authentication error: {0}")]
6 Auth(String),
7
8 #[error("API error: {0}")]
9 Api(String),
10
11 #[error("Tool error: {0}")]
12 Tool(String),
13
14 #[error("Tool not implemented: {0}")]
15 ToolNotImplemented(String),
16
17 #[error("Session error: {0}")]
18 Session(String),
19
20 #[error("MCP error: {0}")]
21 Mcp(String),
22
23 #[error("Skill error: {0}")]
24 Skill(String),
25
26 #[error("Command error: {0}")]
27 Command(String),
28
29 #[error("Internal error: {0}")]
30 Internal(String),
31
32 #[error("Max turns reached: {0}")]
33 MaxTurns(String),
34
35 #[error("User aborted the request")]
36 UserAborted,
37
38 #[error("API connection timeout: {0}")]
39 ApiConnectionTimeout(String),
40
41 #[error("Stream ended without events")]
42 StreamEndedWithoutEvents,
43
44 #[error("404 stream creation error - fallback needed")]
45 Stream404CreationError(String),
46
47 #[error("IO error: {0}")]
48 Io(#[from] std::io::Error),
49
50 #[error("JSON error: {0}")]
51 Json(#[from] serde_json::Error),
52
53 #[error("HTTP error: {0}")]
54 Http(#[from] reqwest::Error),
55}