Crate pyo3_error

Source
Expand description

CI Status MSRV Latest Version Rust Doc Crate Rust Doc Main

Unified error causality chains across Rust and Python using PyErrChain.

Structs§

DowncastToPyErr
Try to map a std::error::Error via a specific error type T to a PyErr by downcasting when used as MapErrorToPyErr;
ErrorNoPyErr
Never attempt to translate any std::error::Error to PyErr when used as AnyErrorToPyErr.
IoErrorToPyErr
Translate std::io::Error to PyErr when used as AnyErrorToPyErr.
PyErrChain
PyErrChain wraps a PyErr together with its causality chain.

Traits§

AnyErrorToPyErr
Utility trait to try to translate from std::error::Error to PyErr.
MapErrorToPyErr
Utility trait to try to translate via specific error types E implementing std::error::Error and wrapped errors such as MyError<E> to PyErrs.

Functions§

err_with_location
Utility function to add a traceback with the error’s file, line, and column location information to the err.