Skip to main content

error_to_pyerr

Function error_to_pyerr 

Source
pub fn error_to_pyerr(err: Error) -> PyErr
Expand description

Convert a crate Error into a PyErr suitable for returning across the PyO3 boundary. Performs structural downcasting so e.g. SyntaxError becomes PySyntaxError and UnsupportedFeature becomes PyNotImplementedError.