From 2e13208758b6cf0036f3e18406e61683b41a0e14 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 26 Jul 2017 11:08:19 +0200 Subject: [PATCH] Improved error reporting. --- .../main/java/org/eclipse/jetty/server/HttpInput.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 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 b2efc08d1fe..ad47630d187 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 @@ -793,9 +793,16 @@ public class HttpInput extends ServletInputStream implements Runnable synchronized (_inputQ) { if (_state instanceof ErrorState) - LOG.warn(x); + { + Throwable failure = new Throwable(_state.getError()); + failure.addSuppressed(new Throwable(x)); + LOG.warn(failure); + } else - _state = new ErrorState(x); + { + // Retain the current stack trace by wrapping the failure. + _state = new ErrorState(new Throwable(x)); + } if (_listener == null) _inputQ.notify();