Fixes #1703 - Improve HttpInput failure logging.

This commit is contained in:
Simone Bordet 2017-08-01 14:21:49 +02:00 committed by Joakim Erdfelt
parent a8ca4d23c6
commit a705f9a2ca
1 changed files with 7 additions and 4 deletions

View File

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