Improved exception reporting.

This commit is contained in:
Simone Bordet 2014-10-13 16:45:25 +02:00
parent 8d85940077
commit 2dba2ea2c2
1 changed files with 4 additions and 3 deletions

View File

@ -260,10 +260,11 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
public void earlyEOF()
{
HttpExchange exchange = getHttpExchange();
HttpConnectionOverHTTP connection = getHttpConnection();
if (exchange == null)
getHttpConnection().close();
connection.close();
else
failAndClose(new EOFException());
failAndClose(new EOFException(String.valueOf(connection)));
}
@Override
@ -274,7 +275,7 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
{
HttpResponse response = exchange.getResponse();
response.status(status).reason(reason);
failAndClose(new HttpResponseException("HTTP protocol violation: bad response", response));
failAndClose(new HttpResponseException("HTTP protocol violation: bad response on " + getHttpConnection(), response));
}
}