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

add suppressed exceptions for with[Auto]Closeable methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.0-beta-1
    • 2.5.0-beta-2
    • groovy-runtime
    • None

    Description

      As with the try-with-resources statement, if multiple exceptions are thrown the exception from the closure should be returned and the exception from closing should be added as a suppressed exception.

      Currently the withCloseable/withAutoCloseable method return the closure exception and log a warning if an exception is thrown on the call to close(). With this improvement the exception from close() would also be added as a suppressed exception to the exception thrown from the closure.

      Attachments

        Issue Links

          Activity

            People

              jwagenleitner John Wagenleitner
              jwagenleitner John Wagenleitner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: