use thiserror::Error;
#[derive(Debug, Error)]
pub enum OfdError {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("zip container error: {0}")]
Zip(#[from] zip::result::ZipError),
#[error("xml parse error: {0}")]
Xml(#[from] quick_xml::DeError),
#[error("invalid {ty} value {value:?}: {reason}")]
BasicType {
ty: &'static str,
value: String,
reason: String,
},
#[error("entry not found in package: {0}")]
EntryNotFound(String),
#[error("invalid OFD structure: {0}")]
Structure(String),
#[error("image codec error: {0}")]
Image(#[from] image::ImageError),
#[error("render error: {0}")]
Render(String),
}
pub type Result<T> = std::result::Result<T, OfdError>;