use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("OPC package error: {0}")]
Opc(#[from] opc::Error),
#[error(
"unrecognized Office format: no word/document.xml, xl/workbook.xml or ppt/presentation.xml part found"
)]
UnrecognizedFormat,
#[error(
"recognized this file as a '{0}' document, but the '{0}' feature isn't enabled in this build"
)]
FormatNotEnabled(&'static str),
#[cfg(feature = "word")]
#[error("Word error: {0}")]
Word(#[from] word_ooxml::Error),
#[cfg(feature = "excel")]
#[error("Excel error: {0}")]
Excel(#[from] excel_ooxml::Error),
#[cfg(feature = "powerpoint")]
#[error("PowerPoint error: {0}")]
Powerpoint(#[from] powerpoint_ooxml::Error),
}
pub type Result<T> = std::result::Result<T, Error>;