1use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum OpcError {
7 #[error("ZIP error: {0}")]
8 Zip(#[from] zip::result::ZipError),
9
10 #[error("I/O error: {0}")]
11 Io(#[from] std::io::Error),
12
13 #[error("XML error: {0}")]
14 Xml(#[from] quick_xml::Error),
15
16 #[error("XML attribute error: {0}")]
17 XmlAttr(#[from] quick_xml::events::attributes::AttrError),
18
19 #[error("part not found: {0}")]
20 PartNotFound(String),
21
22 #[error("invalid content types XML")]
23 InvalidContentTypes,
24
25 #[error("invalid relationship XML")]
26 InvalidRelationship,
27
28 #[error("UTF-8 error: {0}")]
29 Utf8(#[from] std::str::Utf8Error),
30}
31
32pub type Result<T> = std::result::Result<T, OpcError>;