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(
16 "Claude CLI not found in PATH. Install it from: https://docs.anthropic.com/en/docs/claude-code"
17 )]
18 ClaudeNotFound,
19
20 #[error("Failed to spawn Claude CLI: {reason}")]
22 AgentSpawnFailed { reason: String },
23
24 #[error("Slack API error: {0}")]
26 SlackApi(String),
27
28 #[error("IO error: {0}")]
30 Io(#[from] std::io::Error),
31
32 #[error("JSON error: {0}")]
34 Json(#[from] serde_json::Error),
35
36 #[error("TOML parse error: {0}")]
38 Toml(#[from] toml::de::Error),
39
40 #[error("Database error: {0}")]
42 Database(#[from] rusqlite::Error),
43}
44
45pub type Result<T> = std::result::Result<T, HermesError>;