Skip to main content

pangraphx_core/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum PanGraphXError {
5    #[error("I/O Error: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("Parse Error: {0}")]
9    Parse(String),
10
11    #[error("Serialization Error: {0}")]
12    Serialize(String),
13
14    #[error("de Bruijn Error: {0}")]
15    DeBruijn(String),
16
17    #[error("Node ID {node_id} exceeds the maximum supported node ID {max}")]
18    NodeIdTooLarge { node_id: usize, max: usize },
19
20    #[error("Format not supported")]
21    UnsupportedFormat,
22
23    #[error("Other Error: {0}")]
24    Other(String),
25}
26
27pub type PanResult<T> = std::result::Result<T, PanGraphXError>;