use std::error::Error;
pub type ConfigResult<T> = Result<T, ConfigError>;
#[derive(Debug, thiserror::Error)]
pub enum ConfigError {
#[error("unknown config key `{key}`")]
UnknownKey { key: String },
#[error("missing required config key `{key}`")]
MissingRequired { key: String },
#[error("config key `{key}` expected {expected}")]
WrongType { key: String, expected: &'static str },
#[error("invalid default for config key `{key}`: {reason}")]
InvalidDefault { key: String, reason: String },
#[error("invalid secret reference for config key `{key}`: {reason}")]
InvalidSecretRef { key: String, reason: String },
#[error("failed to resolve secret for config key `{key}`: {source}")]
SecretResolution {
key: String,
#[source]
source: Box<dyn Error + Send + Sync>,
},
}