Skip to content

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