#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("zip error: {0}")]
Zip(#[from] zip::result::ZipError),
#[error("xml error: {0}")]
Xml(#[from] quick_xml::Error),
#[error("invalid reference: {0}")]
InvalidReference(String),
#[error("invalid worksheet name: {0}")]
InvalidWorksheetName(String),
#[error("worksheet not found: {0}")]
WorksheetNotFound(String),
#[error("cell out of bounds: {0}")]
OutOfBounds(String),
#[error("shared string not found at index {0}")]
SharedStringNotFound(usize),
#[error("invalid style id {0}")]
InvalidStyleId(usize),
#[error("date conversion error: {0}")]
DateConversion(String),
#[error("{0}")]
Message(String),
}
pub type Result<T> = std::result::Result<T, Error>;
impl Error {
pub fn msg<S: Into<String>>(msg: S) -> Self {
Self::Message(msg.into())
}
}