Search in sources :

Example 6 with TooLongFrameException

use of org.jboss.netty.handler.codec.frame.TooLongFrameException in project NabAlive by jcheype.

the class HttpStaticFileServerHandler method exceptionCaught.

public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
    Channel ch = e.getChannel();
    Throwable cause = e.getCause();
    if (cause instanceof TooLongFrameException) {
        sendError(ctx, BAD_REQUEST);
        return;
    }
    cause.printStackTrace();
    if (ch.isConnected()) {
        sendError(ctx, INTERNAL_SERVER_ERROR);
    }
}
Also used : TooLongFrameException(org.jboss.netty.handler.codec.frame.TooLongFrameException) Channel(org.jboss.netty.channel.Channel)

Aggregations

TooLongFrameException (org.jboss.netty.handler.codec.frame.TooLongFrameException)6 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)2 HttpMessage (org.jboss.netty.handler.codec.http.HttpMessage)2 ClosedChannelException (java.nio.channels.ClosedChannelException)1 Entry (java.util.Map.Entry)1 StartStopListenerDelegate (net.pms.external.StartStopListenerDelegate)1 Channel (org.jboss.netty.channel.Channel)1 ChannelFuture (org.jboss.netty.channel.ChannelFuture)1 DefaultHttpResponse (org.jboss.netty.handler.codec.http.DefaultHttpResponse)1 HttpChunk (org.jboss.netty.handler.codec.http.HttpChunk)1 HttpChunkTrailer (org.jboss.netty.handler.codec.http.HttpChunkTrailer)1 HttpResponse (org.jboss.netty.handler.codec.http.HttpResponse)1