docx_template/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum DocxError {
5    #[error("IO error: {0}")]
6    Io(#[from] std::io::Error),
7    #[error("Zip error: {0}")]
8    Zip(#[from] zip::result::ZipError),
9    #[error("XML error: {0}")]
10    Xml(#[from] quick_xml::Error),
11    #[error("UTF-8 error: {0}")]
12    Utf8(#[from] std::string::FromUtf8Error),
13    #[error("Image not found: {0}")]
14    ImageNotFound(String),
15    #[error("Image url not found: {0}")]
16    InvalidImageUrl(#[from] reqwest::Error),
17    #[error("read image size error: {0}")]
18    ReadImageSize(#[from] image::ImageError),
19    #[error("Not image content type error: {0}")]
20    NotImage(String),
21}