groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8085) Exception in "finally" not caught by outer "try"
Date Fri, 24 Feb 2017 10:09:44 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15882374#comment-15882374
] 

ASF GitHub Bot commented on GROOVY-8085:
----------------------------------------

GitHub user danielsun1106 opened a pull request:

    https://github.com/apache/groovy/pull/504

    GROOVY-8085: Exception in "finally" not caught by outer "try"

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/danielsun1106/groovy GROOVY-8085

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/504.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #504
    
----
commit 0b64cc2fb1c7605fbadefb3166c75d6f97d5a77f
Author: Daniel Sun <realbluesun@hotmail.com>
Date:   2017-02-24T08:39:59Z

    GROOVY-8085: Exception in "finally" not caught by outer "try"

----


> Exception in "finally" not caught by outer "try"
> ------------------------------------------------
>
>                 Key: GROOVY-8085
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8085
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.8
>         Environment: linux
>            Reporter: Craig Silverstein
>
> I would expect the following code to print `caughtt`:
> ```
> groovy -e 'try { try { true; } finally { 1 / 0 } } catch (e) { println "caughtt" }'
> ```
> But instead, it prints:
> ```
> Caught: java.lang.ArithmeticException: Division by zero
> java.lang.ArithmeticException: Division by zero
>         at script_from_command_line.run(script_from_command_line:1)
> ```
> Why is the exception, thrown by the `finally`, not being caught by the outer try/catch?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message