use thiserror::Error;

#[derive(Debug, Error)]
pub enum MpsError {
    #[error("config file not found at {0}")]
    ConfigNotFound(std::path::PathBuf),

    #[error("config invalid: {0}")]
    ConfigInvalid(String),

    #[error("date parse error: '{0}'")]
    DateParseError(String),

    #[error("parse error in {file}: {msg}")]
    ParseError { file: String, msg: String },

    #[allow(dead_code)]
    #[error("export error: {0}")]
    ExportError(String),

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

    #[error("yaml error: {0}")]
    Yaml(#[from] serde_yaml::Error),

    #[error("csv error: {0}")]
    Csv(#[from] csv::Error),

    #[error("time parse error: '{0}'")]
    TimeParse(String),

    #[allow(dead_code)]
    #[error("meta error: {0}")]
    MetaError(String),

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