use thiserror::Error;
#[derive(Debug, Error)]
pub enum ConfigError {
#[error("no configuration file found for '{0}'")]
NotFound(String),
#[error("I/O error reading '{path}': {source}")]
Io {
path: String,
#[source]
source: std::io::Error,
},
#[error("parse error in '{path}': {message}")]
Parse {
path: String,
message: String,
},
#[error("key not found: '{0}'")]
KeyNotFound(String),
#[error("section not found: '{0}'")]
SectionNotFound(String),
#[error("feature '{feature}' is not enabled; recompile with `--features {feature}`")]
FeatureNotEnabled {
feature: &'static str,
},
#[error("{0}")]
Other(String),
}
pub type Result<T, E = ConfigError> = std::result::Result<T, E>;