1#[derive(Debug, thiserror::Error)]
7pub enum RoutexError {
8 #[error("config error: {0}")]
10 Config(String),
11
12 #[error("tool '{name}' is not registered")]
14 ToolNotFound { name: String },
15
16 #[error("tool '{name}' failed: {reason}")]
18 ToolFailed { name: String, reason: String },
19
20 #[error("llm error: {0}")]
22 LLM(String),
23
24 #[error("agent '{id}' failed: {reason}")]
26 AgentFailed { id: String, reason: String },
27
28 #[error("dependency cycle detected involving agent '{id}'")]
31 CyclicDependency { id: String },
32
33 #[error("agent '{id}' depends on '{dep}' which does not exist")]
35 UnknownDependency { id: String, dep: String },
36
37 #[error("http error: {0}")]
39 Http(#[from] reqwest::Error),
40
41 #[error("json error: {0}")]
43 Json(#[from] serde_json::Error),
44
45 #[error("yaml error: {0}")]
47 Yaml(#[from] serde_yaml::Error),
48
49 #[error("io error: {0}")]
51 Io(#[from] std::io::Error),
52}
53
54pub type Result<T> = std::result::Result<T, RoutexError>;