Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4072

finally block not called if exception rethrown in catch block

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.6.8, 1.7.1
    • 1.7.2
    • None
    • None

    Description

      Blah.groovy:

      try {
        throw new Exception()
      } catch (Exception e) {
        println "e: ${e}"
        throw e
      } finally {
        println "finally"
      }
      

      ~/Downloads/groovy-1.6.8/bin/groovy Blah =>

      e: java.lang.Exception
      Caught: java.lang.Exception
      	at Blah.run(Blah.groovy:2)
      

      ~/Downloads/groovy-1.6.7/bin/groovy Blah =>

      e: java.lang.Exception
      finally
      Caught: java.lang.Exception
      	at Blah.run(Blah.groovy:2)
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            mstudman Michael Studman
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: