use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum SettingsError {
#[error("{0}")]
Environment(#[from] std::env::VarError),
#[error(transparent)]
Configuration(#[from] config::ConfigError),
#[error("failed to load option overrides into settings: {0}")]
CliOption(#[from] anyhow::Error),
#[error("{0}")]
IO(#[from] std::io::Error),
#[error("error during system bootstrap: {message}: {setting}")]
Bootstrap { message: String, setting: String },
#[error("infallible operation failed: {0}")]
Infallible(#[from] std::convert::Infallible),
#[error("environment not recognized for name: {0}")]
UnrecognizedEnvironment(String),
}