Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.9-beta-1
-
Component/s: bytecode, class generator, parser, parser-antlr
-
Labels:None
-
Number of attachments :
Description
John Wilson suggested this improved syntax for catching several exceptions at once:
This has been suggested for Java
http://members.capmac.org/~orb/blog.cgi/tech/java/Better_exception_sy.html
I would have thought it's trivial to do in Groovy
try { Field field = someClass.getDeclaredField(someField); someValue = field.getInt(Barcode.class); } catch (SecurityException, NoSuchFieldException e) { // do something else with the exception }
See the thread on the mailing-list for further suggestions:
http://www.nabble.com/Multiple-exception-types-in-a-single-catch-block-tf4086071.html