use std::path::PathBuf;
use snafu::Snafu;
#[derive(Debug, Snafu)]
#[snafu(visibility(pub(crate)))]
pub enum ConfigError {
#[snafu(display("Config can't be loaded from {path:?}"))]
NotLoadable {
path: PathBuf,
source: std::io::Error,
},
#[snafu(display("Config can't be stored to {path:?}"))]
NotStorable {
path: PathBuf,
source: std::io::Error,
},
#[snafu(display("Config folder can't be created under {path:?}"))]
FolderNotCreatable {
path: PathBuf,
source: std::io::Error,
},
#[snafu(display("System config home not set"))]
SystemConfigHomeNotSet,
#[snafu(display("Config not readable from {path:?}"))]
NotReadable {
path: PathBuf,
source: toml::de::Error,
},
#[snafu(display("Config not writeable to {path:?}"))]
NotWriteable {
path: PathBuf,
source: toml::ser::Error,
},
}