-
Notifications
You must be signed in to change notification settings - Fork 183
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
Exception chaining/cause not mirrored into Python #1047
Comments
The Python exception system is mostly hardcoded which makes extensions of it very complicated. You can see the level of hacking that was required to get the stack frames to connect to each other. I have some outstanding tickets with the Python developers regarding providing methods to connect the two together but as I can't contribute to Python (seeing as my employer refuses to sign the contributor agreement) I remain stuck. As for As for making a ValueError appear as a BaseException. This is possible with the reverse bridge. The only issue it that we still having not recruited enough people to serve as beta testers/developers to complete the epypj code. I know that writing 1000 test routines and solving the pile of edge cases are not fun tasks, but it would be required to release that code. |
I looked into this some further. It is possible for me to wire up the I see that that whole system CFrame system is being reworked from 3.11 so it is very unclear if there is any way this can be accomplished in a cross version fashion. At least as far as I can tell, there is no public API for creating tracebacks (so we are hacking that in place), and there is no way in the public API to push a marker into the Python traceback and pop it after the Java call returns such that if an exception took place in Java that we can splice out exception information in. However, perhaps @markshannon be so kind as pointing me towards the API if it exists. |
Both Python and Java have exception chaining (
Throwable.getCause()
in Java,exception.__cause__
in Python).This information doesn't make it across from Java to Python though. Take the following snippet:
When we inspect the object:
By adding the exception to
__cause__
(viae2.__cause__ = e1
) we get an improved exception:In investigating this, I also wondered if I could pass a Python exception as a cause for a
Throwable
, but unfortunately that wasn't possible:I'm not sure on the practicalities, but it would be also interesting if we could make
BaseException
be understood as aThrowable
.The text was updated successfully, but these errors were encountered: