Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Exception in nested try-catch suite is 'leaked' to another enclosing try-catch suite #900
When an exception is raised from a try-catch suite enclosed in another try-catch suite and both suites are trying to catch exception of same type, the exception will be passed directly to the outer suite instead of propagate outwards from inner suite. e.g:
The correct output should be:
But voc produced the following output:
The outer exception handler is placed on top of the Exception table, so when TypeError is thrown, this entry is used by the JVM to resolve exception. The code execution will be redirected to offset 157 (the outer catch handler), bypassing the inner catch handler.
@freakboy3742, is this a bug in the JVM or can we somehow "sort" the Exception table by the label
Have you tried enumerate "e" with a number? Or Have putting your inner try-blocks in triple-quoted blocks inside an "exec" function call?
It appears like it interprets the call to jump to the end of the outer most try-block and responded to its exception handler due to parsing/translation issues. It may also have an issue with an internal ProgramCounter.