1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, Error>;
7
8#[derive(Debug, Error)]
10pub enum Error {
11 #[error("output format '{0}' is not enabled; enable the '{0}' feature in Cargo.toml")]
13 FormatNotEnabled(&'static str),
14
15 #[error("invalid configuration: {0}")]
17 InvalidConfig(String),
18
19 #[error("PNG rendering failed: {0}")]
21 PngRender(String),
22
23 #[error("PDF rendering failed: {0}")]
25 PdfRender(String),
26
27 #[error("PNG encoding failed: {0}")]
29 PngEncode(String),
30
31 #[error("PDF creation failed: {0}")]
33 PdfCreate(String),
34
35 #[error("layout computation failed: {0}")]
37 Layout(String),
38
39 #[error("font error: {0}")]
41 Font(String),
42
43 #[error("I/O error: {0}")]
45 Io(#[from] std::io::Error),
46}