Skip to main content

graphitepdf_errors/
lib.rs

1use std::io;
2
3pub type Result<T> = std::result::Result<T, GraphitePdfError>;
4
5#[derive(Debug, thiserror::Error)]
6pub enum GraphitePdfError {
7    #[error("IO error: {0}")]
8    Io(#[from] io::Error),
9    #[error("invalid PDF object: {0}")]
10    InvalidObject(String),
11    #[error("font error: {0}")]
12    FontError(String),
13    #[error("image error: {0}")]
14    ImageError(String),
15    #[error("invalid page size: {0}")]
16    InvalidPageSize(String),
17    #[error("encoding error: {0}")]
18    EncodingError(String),
19    #[error("compression error: {0}")]
20    CompressionError(String),
21    #[error("invalid argument: {0}")]
22    InvalidArgument(String),
23    #[error("invalid document: {0}")]
24    InvalidDocument(String),
25    #[error("layout error: {0}")]
26    Layout(String),
27    #[error("render error: {0}")]
28    Render(String),
29    #[error("unsupported feature: {0}")]
30    UnsupportedFeature(&'static str),
31}