User Guide

Welcome to the Groovy User Guide. We hope you find it useful.

The User Guide assumes you have already downloaded and installed Groovy. See the Getting Started Guide if this is not the case.

Labels

 
(None)
  1. Aug 07, 2007

    tclwarrior says:

    I can't find an entry/node for exception handling and error handling in groovy. ...

    I can't find an entry/node for exception handling and error handling in groovy. would someone please add it?

  2. Sep 17, 2007

    Tom Nichols says:

    @tclwarrior: It is the same as in Java. The only difference being (of course) E...

    @tclwarrior:

    It is the same as in Java. The only difference being (of course) Exception types are optional:

    try {
      println 1+2
      println 2/0
    }
    catch( ArithmeticException ex ) {
      println "oops!"
    }
    catch( ex ) {
      println "Unexpected exception: ${ex.class.name} : ${ex.message}"
    }
    finally { println "done" }

    See also: JN3035-Exceptions