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

add suppressed exceptions for with[Auto]Closeable methods

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.0-beta-1
    • Fix Version/s: 2.5.0-beta-2
    • Component/s: groovy-runtime
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: