Skip to main content

circulant_rs/python/
error.rs

1// @module: crate::python::error
2// @status: stable
3// @owner: code_expert
4// @feature: python
5// @depends: [crate::CirculantError, pyo3]
6// @tests: [none]
7
8//! Error conversion for Python bindings.
9
10use pyo3::exceptions::PyValueError;
11use pyo3::PyErr;
12
13use crate::CirculantError;
14
15impl From<CirculantError> for PyErr {
16    fn from(err: CirculantError) -> Self {
17        PyValueError::new_err(err.to_string())
18    }
19}