Expand description
Error handling for the catalog module.
§Guide
-
For each encountered error (e.g.
re_uri::Error
when parsing), define a new variant in theError
enum, and implement a mapping to a user-facing Python error in theto_py_err
function. Then, use?
. -
Don’t hesitate to introduce new error classes if this could help the user catch specific errors. Use the [
pyo3::create_exception
] macro for that and updatesuper::register
to expose it. -
Error type (either built-in such as [
pyo3::exceptions::PyValueError
] or custom) can always be used directly using, e.g.PyValueError::new_err("message")
.
Enums§
- Private error type to server as a bridge between various external error type and the
to_py_err
function.
Functions§
- Global mapping of all our internal error to user-facing Python errors.