1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum Error {
8 #[error("entry file not found: {0}")]
10 EntryNotFound(&'static str),
11
12 #[error("entry file is not valid UTF-8")]
14 InvalidUtf8,
15
16 #[error("compilation failed:\n{0}")]
18 Compilation(String),
19
20 #[error("PDF generation failed: {0}")]
22 PdfGeneration(String),
23
24 #[error("PNG encoding failed: {0}")]
26 PngEncoding(String),
27
28 #[error("invalid file path: {0}")]
30 InvalidFilePath(String),
31
32 #[error("invalid page selection: {0}")]
34 InvalidPageSelection(String),
35
36 #[error("decompression failed")]
38 Decompression(#[from] std::io::Error),
39}
40
41pub type Result<T> = std::result::Result<T, Error>;