typst_2_rsx/error.rs
1use std::io;
2
3/// Custom error type `Error` representing possible errors during I/O operations and type conversions.
4///
5/// This enum includes the following variants:
6///
7/// - `Io`: Encapsulates an [`io::Error`], indicating an I/O operation error.
8/// - `Convert`: Encapsulates a [`ConvertError`], indicating a type conversion error.
9///
10/// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
11/// [`ConvertError`]: crate::ConvertError
12#[derive(thiserror::Error, Debug)]
13pub enum Error {
14 /// SVG parsing error.
15 #[error("SVG parsing error: {0}")]
16 SvgParseError(#[from] serde_xml_rs::Error),
17
18 /// Typst compilation error.
19 #[error("Typst compile error: {0}")]
20 TypstCompileError(#[from] io::Error),
21}