Log second and subsequent exceptions as suppressed and add them to the list of suppressed exceptions.
@@ -186,6 +186,9 @@ public class JobListeners {
} catch (IOException e) {
if (exception == null) {
exception = e;
+ } else {
+ LOGGER.warn("JobListener failed while calling close. Suppressed exception beyond first.", e);
+ exception.addSuppressed(e);
}
}
}
