use std::path::PathBuf;
#[derive(Debug, thiserror::Error)]
pub enum FileError {
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("config file not found: searched in {locations}")]
NotFound {
pattern: String,
locations: String,
},
#[error("failed to parse {format} file at {path}: {source}")]
Parse {
path: PathBuf,
format: &'static str,
source: Box<dyn std::error::Error + Send + Sync>,
},
#[error("format '{format}' not supported (feature not enabled)")]
UnsupportedFormat {
format: String,
},
#[error("serialization error: {0}")]
Serialization(String),
}
pub type Result<T> = std::result::Result<T, FileError>;