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

with blocks breaks exception causality chain (Throwable.cause) #255

Open
doublep opened this issue Jun 12, 2023 · 0 comments
Open

with blocks breaks exception causality chain (Throwable.cause) #255

doublep opened this issue Jun 12, 2023 · 0 comments

Comments

@doublep
Copy link

doublep commented Jun 12, 2023

To reproduce:

  1. Run attached example (a simple Gradle-based project with only one Java file)

  2. See the following output:

    1. Throwing directly
    Exception of type org.python.core.PyException (__builtin__.test$MyException: test$MyException: foo)
    Caused by exception of type test$MyException (__builtin__.test$MyException: test$MyException: foo)
    2. Throwing inside a context manager block
    Exception of type org.python.core.PyException (__builtin__.test$MyException: test$MyException: foo)
    

I would expect that exception in the second case is exactly the same, with the same cause. Yes, message and printed stacktrace looks fine, but from programming point of view it incorrectly lacks a cause (as in Throwable.getCause()).
jython.tar.gz

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

No branches or pull requests

1 participant