use suppressed exceptions to hold local stacktrace rather than wrapping exception, which hides the exception type.
This commit is contained in:
Greg Wilkins 2017-08-01 11:24:56 +10:00 committed by Joakim Erdfelt
parent 7c4f7b13f7
commit d12cde9cfd
1 changed files with 5 additions and 4 deletions

View File

@ -794,14 +794,15 @@ public class HttpInput extends ServletInputStream implements Runnable
{
if (_state instanceof ErrorState)
{
Throwable failure = new Throwable(_state.getError());
failure.addSuppressed(new Throwable(x));
IOException failure = new IOException(x);
LOG.warn(failure);
_state.getError().addSuppressed(failure);
}
else
{
// Retain the current stack trace by wrapping the failure.
_state = new ErrorState(new Throwable(x));
// Add a suppressed throwable to capture this stack trace
x.addSuppressed(new IOException("HttpInput failed"));
_state = new ErrorState(x);
}
if (_listener == null)