use thiserror::Error;

#[derive(Error, Debug)]
pub enum DaemonError {
    #[error("NCL export failed for {path}: {reason}")]
    NclExport { path: String, reason: String },

    #[error("File watcher error: {0}")]
    Watcher(String),

    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),

    #[error("JSON error: {0}")]
    Json(#[from] serde_json::Error),

    #[error("Configuration error: {0}")]
    Config(String),

    #[cfg(feature = "db")]
    #[error("Database error: {0}")]
    Db(#[from] stratum_db::DbError),
}

pub type Result<T> = std::result::Result<T, DaemonError>;
