Skip to content
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

guide: show exporting create_exception! exceptions in a module #1099

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

birkenfeld
Copy link
Member

This was asked about in Gitter; #805 seemed to suggest to them that it is not possible.

@davidhewitt
Copy link
Member

Thank you for adding this!

@davidhewitt davidhewitt merged commit c81013b into PyO3:master Aug 10, 2020
@kngwyu
Copy link
Member

kngwyu commented Aug 11, 2020

Can we use these exceptions for catching error?
In #805, somehow an exception raised in #[pyfunction] and imported one are treated as different errors.

@birkenfeld
Copy link
Member Author

This worked when I tried it:

try:
    rustmod.func()
except rustmod.CustomError:
    ...

where rustmod.func() raises the exception.

@birkenfeld birkenfeld deleted the guide-exc branch August 11, 2020 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants