1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum HermesError {
6 #[error("Configuration error: {0}")]
8 Config(String),
9
10 #[error("Session not found for thread '{0}'")]
12 SessionNotFound(String),
13
14 #[error("Claude CLI not found in PATH. Install it from: https://docs.anthropic.com/en/docs/claude-code")]
16 ClaudeNotFound,
17
18 #[error("Failed to spawn Claude CLI: {reason}")]
20 AgentSpawnFailed { reason: String },
21
22 #[error("Slack API error: {0}")]
24 SlackApi(String),
25
26 #[error("IO error: {0}")]
28 Io(#[from] std::io::Error),
29
30 #[error("JSON error: {0}")]
32 Json(#[from] serde_json::Error),
33
34 #[error("TOML parse error: {0}")]
36 Toml(#[from] toml::de::Error),
37}
38
39pub type Result<T> = std::result::Result<T, HermesError>;