-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Map std::nested_exceptions to Python equivalent #1913
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
Comments
This would be really valuable for us as well since our library relies heavily on nested exceptions. An exception hierarchy in C++ typically looks like:
Unfortunately, our wrapper raises a plan exceptions with only the |
We now support raise_from with PyBind11 so we really should revisit this. |
@nedrebo @ingomueller-net Would either of you be interested in working on this? It should be doable without too much effort with using |
@ingomueller-net @nedrebo Just opened a PR #3608 to add support for this issue. |
I want to collect ideas whether and how one could map
std::nested_exception
s to Python's chained exceptions from araise ... from
clause and vice versa. These seem to be the corresponding language features in the two languages, and hence could be an interesting addition to pybind. My expectation is that this would provide more information in case of exceptions that cross language barriers.I have done only very initial research, but if there is interest from the side of this project, I might be able to invest some more time, potentially with ideas and help from others.
The text was updated successfully, but these errors were encountered: