1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, PDF2ImageError>;
5
6#[derive(Error, Debug)]
8pub enum PDF2ImageError {
9 #[error("i/o error: {0}")]
11 Io(#[from] std::io::Error),
12 #[error("utf-8 parsing error: {0}")]
14 Utf8(#[from] std::str::Utf8Error),
15 #[error("int parsing error: {0}")]
17 ParseInt(#[from] std::num::ParseIntError),
18 #[error("image error: {0}")]
20 ImageError(#[from] image::ImageError),
21 #[error("RenderOptionsBuilder error: {0}")]
23 RenderOptionsBuilder(#[from] crate::render_options::RenderOptionsBuilderError),
24 #[error("No password given for encrypted PDF")]
26 NoPasswordForEncryptedPDF,
27 #[error("unable to extract page count")]
28 UnableToExtractPageCount,
29 #[error("unable to extract encryption status")]
30 UnableToExtractEncryptionStatus,
31}