jetty-9 improved exception logging
This commit is contained in:
parent
cb4e7982b1
commit
96dc4fe150
|
@ -938,7 +938,7 @@ public class HttpParser
|
|||
Thread.sleep(100);
|
||||
String chars = BufferUtil.toDetailString(buffer);
|
||||
BufferUtil.clear(buffer);
|
||||
throw new IllegalStateException(String.format("%s %d/%d data when CLOSED:%s",this,len,_headerBytes,chars));
|
||||
throw new IllegalStateException(String.format("%s %d/%d>%d data when CLOSED:%s",this,len,_headerBytes,_maxHeaderBytes,chars));
|
||||
}
|
||||
BufferUtil.clear(buffer);
|
||||
}
|
||||
|
|
|
@ -577,6 +577,14 @@ public class HttpChannel<T> implements HttpParser.RequestHandler<T>, Runnable
|
|||
if (info.getStatus() < 200)
|
||||
_committed.set(false);
|
||||
}
|
||||
catch (EofException e)
|
||||
{
|
||||
LOG.debug(e);
|
||||
// TODO is it worthwhile sending if we are at EoF?
|
||||
// "application" info failed to commit, commit with a failsafe 500 info
|
||||
_transport.send(HttpGenerator.RESPONSE_500_INFO,null,true);
|
||||
throw e;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.warn(e);
|
||||
|
|
|
@ -114,7 +114,7 @@ public class HttpOutput extends ServletOutputStream
|
|||
_channel.write(BufferUtil.EMPTY_BUFFER, false);
|
||||
}
|
||||
|
||||
public boolean checkAllWritten()
|
||||
public boolean checkAllWritten() throws IOException
|
||||
{
|
||||
return _channel.getResponse().checkAllContentWritten(_written);
|
||||
}
|
||||
|
|
|
@ -702,14 +702,21 @@ public class Response implements HttpServletResponse
|
|||
_fields.putLongField(HttpHeader.CONTENT_LENGTH.toString(), len);
|
||||
|
||||
if (_contentLength > 0)
|
||||
checkAllContentWritten(written);
|
||||
}
|
||||
|
||||
public boolean checkAllContentWritten(long written)
|
||||
{
|
||||
if (_contentLength >= 0 && written >= _contentLength)
|
||||
{
|
||||
try
|
||||
{
|
||||
checkAllContentWritten(written);
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
throw new RuntimeIOException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkAllContentWritten(long written) throws IOException
|
||||
{
|
||||
if (_contentLength >= 0 && written >= _contentLength)
|
||||
{
|
||||
switch (_outputType)
|
||||
{
|
||||
|
@ -719,11 +726,6 @@ public class Response implements HttpServletResponse
|
|||
case STREAM:
|
||||
getOutputStream().close();
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeIOException(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue