use thiserror::Error;
#[derive(Error, Debug)]
pub enum DaemonError {
#[error("Failed to bind to socket: {0}")]
BindFailed(String),
#[error("Failed to acquire lock: {0}")]
LockFailed(String),
#[error("grite error: {0}")]
Core(#[from] libgrite_core::GriteError),
#[error("Git error: {0}")]
Git(#[from] libgrite_git::GitError),
#[error("IPC error: {0}")]
Ipc(#[from] libgrite_ipc::IpcError),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Invalid state transition from {from} to {to}")]
InvalidStateTransition { from: String, to: String },
}