Skip to main content

grite_daemon/
error.rs

1//! Daemon-specific error types
2
3use thiserror::Error;
4
5/// Errors specific to daemon operations
6#[derive(Error, Debug)]
7pub enum DaemonError {
8    /// Failed to bind to IPC socket
9    #[error("Failed to bind to socket: {0}")]
10    BindFailed(String),
11
12    /// Failed to acquire daemon lock
13    #[error("Failed to acquire lock: {0}")]
14    LockFailed(String),
15
16    /// Core grite error
17    #[error("grite error: {0}")]
18    Core(#[from] libgrite_core::GriteError),
19
20    /// Git error
21    #[error("Git error: {0}")]
22    Git(#[from] libgrite_git::GitError),
23
24    /// IPC error
25    #[error("IPC error: {0}")]
26    Ipc(#[from] libgrite_ipc::IpcError),
27
28    /// IO error
29    #[error("IO error: {0}")]
30    Io(#[from] std::io::Error),
31
32    /// JSON error
33    #[error("JSON error: {0}")]
34    Json(#[from] serde_json::Error),
35
36    /// Invalid state transition
37    #[error("Invalid state transition from {from} to {to}")]
38    InvalidStateTransition { from: String, to: String },
39}