Improved error reporting.

This commit is contained in:
Simone Bordet 2017-07-26 11:08:19 +02:00 committed by Joakim Erdfelt
parent e81e17d348
commit 3eeeb8ec7e
1 changed files with 9 additions and 2 deletions

View File

@ -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();