use thiserror::Error;
#[derive(Error, Debug)]
pub enum DecodeError {
#[error("Zip error: {0}")]
Zip(#[from] zip::result::ZipError),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Expected item not found: {0}")]
NotFound(String),
#[error("Invalid data: {0}")]
InvalidData(String),
#[error("Unknown {0}: {1}")]
Unknown(String, String),
}
#[derive(Error, Debug)]
pub enum BuilderError {
#[error("No source specified for the decoder.")]
NoSource,
#[error("Failed to read the specified file: {0}")]
FileRead(#[from] std::io::Error),
#[error("Decoding error: {0}")]
Decode(#[from] DecodeError),
}