avenger 0.0.3

A visualization engine and renderer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

#[cfg(feature = "pyo3")]
use pyo3::{exceptions::PyValueError, PyErr};

#[derive(Error, Debug)]
pub enum AvengerError {
    #[error("Internal error: `{0}`")]
    InternalError(String),
}

// Conversion to PyO3 error
#[cfg(feature = "pyo3")]
impl From<AvengerError> for PyErr {
    fn from(err: AvengerError) -> PyErr {
        PyValueError::new_err(err.to_string())
    }
}