use std::path::PathBuf;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("validation failed: {0}")]
Validation(String),
#[error("failed to access {path}: {source}")]
Io {
path: PathBuf,
source: std::io::Error,
},
#[error("invalid YAML: {0}")]
Yaml(#[from] serde_yaml::Error),
#[error("git operation failed: {0}")]
Git(String),
#[error("invalid semantic version: {0}")]
Semver(#[from] semver::Error),
}
impl Error {
pub(crate) fn io(path: impl Into<PathBuf>, source: std::io::Error) -> Self {
Self::Io {
path: path.into(),
source,
}
}
}