pangraphx-core 0.1.8

Core library for PanGraphX: a toolkit for genome graph loading and format conversion.
use thiserror::Error;

#[derive(Error, Debug)]
pub enum PanGraphXError {
    #[error("I/O Error: {0}")]
    Io(#[from] std::io::Error),

    #[error("Parse Error: {0}")]
    Parse(String),

    #[error("Serialization Error: {0}")]
    Serialize(String),

    #[error("Invalid graph: {0}")]
    InvalidGraph(String),

    #[error("de Bruijn Error: {0}")]
    DeBruijn(String),

    #[error("Node ID {node_id} exceeds the maximum supported node ID {max}")]
    NodeIdTooLarge { node_id: usize, max: usize },

    #[error("Format not supported")]
    UnsupportedFormat,

    #[error("Other Error: {0}")]
    Other(String),
}

pub type PanResult<T> = std::result::Result<T, PanGraphXError>;