groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edinson E. Padrón Urdaneta <edinson.padron.urdan...@gmail.com>
Subject Re: Is it possible to implement in the language an `else` block in exception handling?
Date Mon, 28 Sep 2015 08:22:46 GMT
On Mon, Sep 28, 2015 at 3:22 AM, Maarten Boekhold <boekhold@gmx.com> wrote:

> Just put the 'else'  code at the end of the try block!
>
> Maarten
>
​
That's not a satisfactory answer for my question.​ Besides, what would
happen if the code that throws the exception is part of a return sentence?
What if the 'else code' that is after the code that throws the exception
throws one of its own and it's captured by the catch block(s)? In the other
hand, isn't more clear to have inside the try block only the code that
should be 'tested for an exceptional situation'?

Mime
View raw message