Open
Description
Hi,
would it be possible to wrap the pyo3_runtime.PanicException
raised by Python ffi bindings in pyo3
to your own custom exception which would inherit from Exception
class and be exportable to third party code?
I'm running the code in Celery task and they're somewhat allergic to System exceptions caused by unhandled Rust code.
For mode details see this post
So far, I'm forced to use this solution:
try:
# run some whitebox functionality
except BaseException as exc:
# solution to avoid installing `pyo3` dependency
if exc.__class__.__name__ == "PanicException":
raise WbPanicException(
"Whitebox function failed with unexpected exception"
) from exc
Thank you.
Metadata
Metadata
Assignees
Labels
No labels