Skip to main content

graphitepdf_image/
error.rs

1pub type Result<T> = std::result::Result<T, Error>;
2
3#[derive(Debug, thiserror::Error)]
4pub enum Error {
5    #[error(transparent)]
6    GraphitepdfErrors(#[from] graphitepdf_errors::GraphitePdfError),
7
8    #[error(transparent)]
9    Io(#[from] std::io::Error),
10
11    #[error(transparent)]
12    Http(#[from] reqwest::Error),
13
14    #[error(transparent)]
15    Base64(#[from] base64::DecodeError),
16
17    #[error(transparent)]
18    Utf8(#[from] std::str::Utf8Error),
19
20    #[error(transparent)]
21    Svg(#[from] graphitepdf_svg::Error),
22
23    #[error("invalid image data: {message}")]
24    InvalidImageData { message: String },
25
26    #[error("unsupported image format: {format}")]
27    UnsupportedImageFormat { format: String },
28}