use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("entry file not found: {0}")]
EntryNotFound(&'static str),
#[error("entry file is not valid UTF-8")]
InvalidUtf8,
#[error("compilation failed:\n{0}")]
Compilation(String),
#[error("PDF generation failed: {0}")]
PdfGeneration(String),
#[error("PNG encoding failed: {0}")]
PngEncoding(String),
#[error("invalid file path: {0}")]
InvalidFilePath(String),
#[error("invalid page selection: {0}")]
InvalidPageSelection(String),
#[error("decompression failed")]
Decompression(#[from] std::io::Error),
}
pub type Result<T> = std::result::Result<T, Error>;