-
I'm facing an issue while trying to create a custom exception in PyO3 with custom data. I have looked at the implementation of When I try to import my module I get the error:
This is my exception implementation:
And I'm adding the exception in this way:
Ideas? Thanks!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Ok, I think I've found a way but without using the create_exception! macro.
And this how I'm creating a new instance of it:
|
Beta Was this translation helpful? Give feedback.
-
In general if that works could we make it the preferred way to implement new exceptions? (@davidhewitt @adamreichold) Maybe a bit of special sauce in |
Beta Was this translation helpful? Give feedback.
Ok, I think I've found a way but without using the create_exception! macro.
This is the custom exception definition:
And this how I'm creating a new instance of it: