cstats_hook/error.rs
1//! Error types for cstats-hook
2
3/// Result type alias for hook operations
4pub type Result<T> = std::result::Result<T, Error>;
5
6/// Error types for hook generation
7#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 /// Unsupported shell type
10 #[error("Unsupported shell type: {0}")]
11 UnsupportedShell(String),
12
13 /// Template processing error
14 #[error("Template error: {0}")]
15 Template(String),
16
17 /// I/O error
18 #[error("I/O error: {0}")]
19 Io(#[from] std::io::Error),
20
21 /// JSON serialization/deserialization error
22 #[error("JSON error: {0}")]
23 Json(#[from] serde_json::Error),
24
25 /// Configuration error
26 #[error("Configuration error: {0}")]
27 Config(String),
28}