From a705f9a2ca4c7b36ee7dfa631282ee561bc6d019 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 1 Aug 2017 14:21:49 +0200 Subject: [PATCH] Fixes #1703 - Improve HttpInput failure logging. --- .../main/java/org/eclipse/jetty/server/HttpInput.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java index 3654f23cd93..dcaae2593f5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java @@ -794,14 +794,17 @@ public class HttpInput extends ServletInputStream implements Runnable { if (_state instanceof ErrorState) { - IOException failure = new IOException(x); + // Log both the original and current failure + // without modifying the original failure. + Throwable failure = new Throwable(((ErrorState)_state).getError()); + failure.addSuppressed(x); LOG.warn(failure); - _state.getError().addSuppressed(failure); } else { - // Add a suppressed throwable to capture this stack trace - x.addSuppressed(new IOException("HttpInput failed")); + // Add a suppressed throwable to capture this stack + // trace without wrapping/hiding the original failure. + x.addSuppressed(new Throwable("HttpInput failure")); _state = new ErrorState(x); }