-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyo3-error crate #4500
Comments
What is the performance impact of converting all source errors into rust compared to a plain PyErr? |
At the moment, this conversion scales linearly with the length of the causal chain. An alternative design I could think of is one that would provide a zero-cost wrapper around Since I personally prefer the snapshot approach, I went with that one for the initial implementation. I'd be delighted to hear if you have some ideas for how the API and its cost could be improved :) |
I've recently been down a rabbit hole to improve error reporting across Python and Rust with preserved causality chains and just published the first version of my new https://github.com/juntyr/pyo3-error crate.
Most importantly, the crate provides conversions from
std::error::Error::source
causal chains topyo3::PyErr::cause
chains and a wrapper forPyErr
to interpret itspyo3::PyErr::cause
chain as astd::error::Error::source
chain.I hope that this crate might be useful to the broader PyO3 community (and I am sure someone will have ideas for how to make its API a lot more convenient :) )
The text was updated successfully, but these errors were encountered: