/** * Calls {@link ChannelHandlerContext#fireExceptionCaught(Throwable)} to forward * to the next {@link ChannelHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ctx.fireExceptionCaught(cause); } }
/** * Calls {@link ChannelHandlerContext#fireExceptionCaught(Throwable)} to forward * to the next {@link ChannelHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ctx.fireExceptionCaught(cause); } }
@Override public ChannelHandlerContext fireExceptionCaught(Throwable cause) { ctx.fireExceptionCaught(cause); return this; }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { ctx.fireExceptionCaught(cause); }
@Override public ChannelHandlerContext fireExceptionCaught(Throwable cause) { ctx.fireExceptionCaught(cause); return this; }
@Override public ChannelHandlerContext fireExceptionCaught(Throwable cause) { ctx.fireExceptionCaught(cause); return this; }
/** * Calls {@link ChannelHandlerContext#fireExceptionCaught(Throwable)} to forward * to the next {@link ChannelHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ctx.fireExceptionCaught(cause); } }
/** * Calls {@link ChannelHandlerContext#fireExceptionCaught(Throwable)} to forward * to the next {@link ChannelHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ctx.fireExceptionCaught(cause); } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { ctx.fireExceptionCaught(future.cause()); } } };
/** * Is called when a read timeout was detected. */ protected void readTimedOut(ChannelHandlerContext ctx) throws Exception { if (!closed) { ctx.fireExceptionCaught(ReadTimeoutException.INSTANCE); ctx.close(); closed = true; } } }
/** * Is called when a write timeout was detected */ protected void writeTimedOut(ChannelHandlerContext ctx) throws Exception { if (!closed) { ctx.fireExceptionCaught(WriteTimeoutException.INSTANCE); ctx.close(); closed = true; } }
@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { ctx.fireExceptionCaught(future.cause()); } } };
private void fail(final ChannelHandlerContext ctx, String length) { ctx.fireExceptionCaught( new TooLongFrameException( "frame length (" + length + ") exceeds the allowed maximum (" + maxLength + ')')); }
private static void fail(ChannelHandlerContext ctx) { ctx.fireExceptionCaught(new CorruptedFrameException("frame contains content before the xml starts")); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { // To ensure we not miss to flush anything, do it now. resetReadAndFlushIfNeeded(ctx); ctx.fireExceptionCaught(cause); }
private void fail(final ChannelHandlerContext ctx, String length) { ctx.fireExceptionCaught( new TooLongFrameException( "frame length (" + length + ") exceeds the allowed maximum (" + maxLength + ')')); }
/** * Invoked when an incoming request exceeds the maximum content length. The default behvaior is to trigger an * {@code exceptionCaught()} event with a {@link TooLongFrameException}. * * @param ctx the {@link ChannelHandlerContext} * @param oversized the accumulated message up to this point, whose type is {@code S} or {@code O} */ protected void handleOversizedMessage(ChannelHandlerContext ctx, S oversized) throws Exception { ctx.fireExceptionCaught( new TooLongFrameException("content length exceeded " + maxContentLength() + " bytes.")); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { final ChannelConfig config = ctx.channel().config(); if (config.isAutoRead()) { // stop accept new connections for 1 second to allow the channel to recover // See https://github.com/netty/netty/issues/1328 config.setAutoRead(false); ctx.channel().eventLoop().schedule(enableAutoReadTask, 1, TimeUnit.SECONDS); } // still let the exceptionCaught event flow through the pipeline to give the user // a chance to do something with it ctx.fireExceptionCaught(cause); } }
/** * Invoked when an incoming request exceeds the maximum content length. The default behvaior is to trigger an * {@code exceptionCaught()} event with a {@link TooLongFrameException}. * * @param ctx the {@link ChannelHandlerContext} * @param oversized the accumulated message up to this point, whose type is {@code S} or {@code O} */ protected void handleOversizedMessage(ChannelHandlerContext ctx, S oversized) throws Exception { ctx.fireExceptionCaught( new TooLongFrameException("content length exceeded " + maxContentLength() + " bytes.")); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (logger.isEnabled(internalLevel)) { logger.log(internalLevel, format(ctx, "EXCEPTION", cause), cause); } ctx.fireExceptionCaught(cause); }