Created
March 18, 2014 08:59
-
-
Save jkyamog/9616210 to your computer and use it in GitHub Desktop.
handling 414
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event.getCause match { | |
// IO exceptions happen all the time, it usually just means that the client has closed the connection before fully | |
// sending/receiving the response. | |
case e: IOException => nettyExceptionLogger.trace("Benign IO exception caught in Netty", e) | |
event.getChannel.close() | |
case e: TooLongFrameException => nettyExceptionLogger.warn("Handling TooLongFrameException", e) | |
val response = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.REQUEST_URI_TOO_LONG) | |
response.setHeader("connection", "close") | |
val dme = new DownstreamMessageEvent(ctx.getChannel, Channels.future(ctx.getChannel), response, ctx.getChannel.getRemoteAddress) | |
ctx.sendDownstream(dme); | |
case e => nettyExceptionLogger.error("Exception caught in Netty", e) | |
event.getChannel.close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment