use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum Error {
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("PDF parse error: {0}")]
Pdf(#[from] lopdf::Error),
#[error("invalid content stream on page {page}: {reason}")]
ContentStream {
page: usize,
reason: String,
},
#[error("unsupported feature: {0}")]
Unsupported(&'static str),
#[error("font decoding failed: {0}")]
Font(String),
#[error("page index {0} out of bounds")]
PageOutOfBounds(usize),
}