use crate::config_loader::ParseFileFormatError;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Serialization error: {0:?}")]
Serde(#[from] serde_json::Error),
#[error("TOML error: {0}")]
Toml(#[from] toml::de::Error),
#[error("YAML error: {0}")]
Yaml(#[from] serde_yaml::Error),
#[error("Parse file format error")]
ParseFileFormat(#[from] ParseFileFormatError),
#[error("Config parsing error for type {type_name}: {source:?}")]
ConfigParse {
type_name: &'static str,
#[source]
source: serde_json::Error,
},
#[error("Environment error: {0}")]
Environment(String),
#[error("Validation error: {0}")]
Validation(String),
}