use std::path::PathBuf;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum PackError {
#[error("pack I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("pack walk error: {0}")]
Walk(#[from] walkdir::Error),
#[error("not a directory: {0}")]
NotADirectory(PathBuf),
#[error("invalid pack pattern '{pattern}': {message}")]
BadPattern {
pattern: String,
message: String,
},
#[error("manifest serialize error: {0}")]
ManifestSerialize(#[from] toml::ser::Error),
#[error("manifest parse error: {0}")]
ManifestParse(#[from] toml::de::Error),
#[error("archive has no {name} entry — not an lds pack?", name = crate::manifest::MANIFEST_NAME)]
MissingManifest,
#[error("pack format version {found} is newer than supported version {supported}")]
UnsupportedFormat {
found: u32,
supported: u32,
},
#[error("destination already exists: {0}")]
DestinationExists(PathBuf),
}