use thiserror::Error;
pub type Result<T> = std::result::Result<T, OoxmlError>;
#[derive(Error, Debug)]
pub enum OoxmlError {
#[error("OPC error: {0}")]
Opc(#[from] crate::ooxml::opc::error::OpcError),
#[error("XML error: {0}")]
Xml(String),
#[error("Part not found: {0}")]
PartNotFound(String),
#[error("Invalid content type: expected {expected}, got {got}")]
InvalidContentType { expected: String, got: String },
#[error("Invalid relationship: {0}")]
InvalidRelationship(String),
#[error("Invalid format: {0}")]
InvalidFormat(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("{0}")]
Other(String),
}
impl From<quick_xml::Error> for OoxmlError {
fn from(err: quick_xml::Error) -> Self {
OoxmlError::Xml(err.to_string())
}
}