use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum Error {
#[error("Could not parse {0} as a URL or reference")]
BadUrl(String),
#[error("Could not read file {}", .0.display())]
LoadError(PathBuf),
#[error("Pulling asset {} failed: {1}", .0.display())]
PullFailed(PathBuf, String),
#[error("Normalization failed for path '{0}': {1}")]
NormalizationFailure(String, String),
#[error("File or directory {} not found", .0.display())]
NotFound(PathBuf),
#[error("Could not resolve {0} to a filesystem location or an OCI reference")]
Unresolvable(String),
#[error("File {} does not reside in target directory {1}", .0.display())]
FileEscapesRoot(PathBuf, String),
}