verglas/
error.rs

1use thiserror::Error;
2
3#[cfg(feature = "forge")]
4use write_fonts::{error::Error as WriteError, BuilderError};
5
6#[derive(Error, Debug)]
7pub enum Error {
8    #[error("failed to create font file: {0}")]
9    Io(#[from] std::io::Error),
10
11    #[error("failed to create font file: {0}")]
12    FontRead(#[from] read_fonts::ReadError),
13
14    #[error("no icons found in source")]
15    NoIconsFound,
16
17    #[error("destination not valid")]
18    InvalidDestination(String),
19
20    #[cfg(feature = "forge")]
21    #[error("SVG parsing error: {0}")]
22    SvgParse(#[from] usvg::Error),
23
24    #[error("failed to create font: {0}")]
25    FontCreation(String),
26
27    #[error("failed to create glyph: {0}")]
28    GlyphConversion(String),
29
30    #[cfg(feature = "forge")]
31    #[error("failed to build font table: {0}")]
32    BuildFontTable(#[from] BuilderError),
33
34    #[cfg(feature = "forge")]
35    #[error("write fonts error: {0}")]
36    WriteFont(#[from] WriteError),
37}