use std::io;
use std::str::Utf8Error;
use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ManifestError {
#[error("failed to read manifest: {0}")]
Io(#[from] io::Error),
#[error("manifest size {size} exceeds maximum {max}")]
FileTooLarge {
size: u64,
max: u64,
},
#[error("manifest json parse error: {0}")]
Json(#[from] serde_json::Error),
#[error("manifest contains invalid utf-8: {source}")]
InvalidUtf8 {
#[source]
source: Utf8Error,
},
#[error("manifest validation error: {message}")]
Validation {
message: String,
},
}