Re: non-catchable exception?

2016-10-12 Thread OC
Thanks alot to all! My bad: I completely forgot that “catch (foo)” implies Exception foo, and not Throwable foo. OC On 12. 10. 2016, at 18:59, Jim White wrote: > The recommended way to have an exception that can't be caught except in > specifically intended places is to extend java.lang.Throwa

Re: non-catchable exception?

2016-10-12 Thread Jim White
The recommended way to have an exception that can't be caught except in specifically intended places is to extend java.lang.Throwable (or if appropriate to the use case, java.lang.Error). Those work just like Exception except that they don't have to be declared in the method signatures where they

Re: non-catchable exception?

2016-10-12 Thread Dinko Srkoč
On 12 October 2016 at 18:27, Søren Berg Glasius wrote: > This question should be asked in us...@groovy.apache.org > > And the answer to the question must be, no. But you could check if Well, strictly speaking, that's not quite true ;-) @groovy.transform.InheritConstructors class MySpecialExc

Re: non-catchable exception?

2016-10-12 Thread Søren Berg Glasius
This question should be asked in us...@groovy.apache.org And the answer to the question must be, no. But you could check if } catch (exception) { if(exception instance MySpecialException) throw exception println "bar caught $exception" } Best regards, Søren Berg Glasius Hedevej 1, Gl.