use thiserror::Error;
pub type Result<T> = std::result::Result<T, PDF2ImageError>;
#[derive(Error, Debug)]
pub enum PDF2ImageError {
#[error("i/o error: {0}")]
Io(#[from] std::io::Error),
#[error("utf-8 parsing error: {0}")]
Utf8(#[from] std::str::Utf8Error),
#[error("int parsing error: {0}")]
ParseInt(#[from] std::num::ParseIntError),
#[error("image error: {0}")]
ImageError(#[from] image::ImageError),
#[error("RenderOptionsBuilder error: {0}")]
RenderOptionsBuilder(#[from] crate::render_options::RenderOptionsBuilderError),
#[error("No password given for encrypted PDF")]
NoPasswordForEncryptedPDF,
#[error("unable to extract page count")]
UnableToExtractPageCount,
#[error("unable to extract encryption status")]
UnableToExtractEncryptionStatus,
}