use std::path::PathBuf;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("failed to read config file `{path}`")]
Read {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("failed to resolve config path `{path}`")]
ResolvePath {
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("unsupported config format for `{path}`")]
UnknownFormat {
path: PathBuf,
},
#[error("failed to parse `{path}` as {format}")]
Parse {
path: PathBuf,
format: &'static str,
#[source]
source: Box<dyn std::error::Error + Send + Sync>,
},
#[error("failed to watch config file `{path}`")]
Watch {
path: PathBuf,
#[source]
source: notify::Error,
},
#[error("config watcher stopped")]
WatchClosed,
}