Refine search
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { logger.warn("Unexpected exception from client", e.getCause()); e.getChannel().close(); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { // removeFailureCounter(e.getChannel()); if (e.getChannel() != null) { LOG.info("Channel occur exception {}, cause={}", e.getChannel().getRemoteAddress(), e.getCause()); } server.closeChannel(e.getChannel()); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { Throwable cause = e.getCause(); if (cause instanceof SpdyProtocolException) { issueSessionError(ctx, e.getChannel(), null, SpdySessionStatus.PROTOCOL_ERROR); } super.exceptionCaught(ctx, e); }
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { logger.error("something goes wrong with channel:{}, exception={}", ctx.getChannel(), ExceptionUtils.getStackTrace(e.getCause())); ctx.getChannel().close(); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler); try { handler.caught(channel, e.getCause()); } finally { NettyChannel.removeChannelIfDisconnected(ctx.getChannel()); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { LoggerUtil.error("NettyChannelHandler exceptionCaught: remote=" + ctx.getChannel().getRemoteAddress() + " local=" + ctx.getChannel().getLocalAddress() + " event=" + e.getCause(), e.getCause()); ctx.getChannel().close(); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (e.getCause() instanceof WebSocketHandshakeException) { DefaultHttpResponse response = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.BAD_REQUEST); response.setContent(ChannelBuffers.wrappedBuffer(e.getCause().getMessage().getBytes())); ctx.getChannel().write(response).addListener(ChannelFutureListener.CLOSE); } else { ctx.getChannel().close(); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { logger.error("Exception caught",e.getCause()); ctx.getChannel().write(new DefaultHttpResponse(HttpVersion.HTTP_1_1,HttpResponseStatus.INTERNAL_SERVER_ERROR)).addListener(ChannelFutureListener.CLOSE); }
@Override public void exceptionCaught(ChannelHandlerContext c, ExceptionEvent e) { final Throwable cause = e.getCause(); if (cause instanceof ConnectException) { startTime = -1; } else if (cause instanceof ReadTimeoutException) { // The connection was OK but there was no traffic for the last period. } else { c.sendUpstream(e); } c.getChannel().close(); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { final Channel channel = ctx.getChannel(); if (channel == null) { // For the case where this pipeline is not attached yet. handshakeFuture.setFailure(new ChannelException( StringUtils.format("Channel is null. The context name is [%s]", ctx.getName()) )); return; } handshakeFuture.setFailure(e.getCause()); if (channel.isOpen()) { channel.close(); } } });
public static void exceptionCaught(final ExceptionEvent e) { if (e.getCause() instanceof ClosedChannelException) { logger.info("exception: {}", e); } else if(e.getCause() instanceof IOException) { logger.info("exception: {}", e.getCause().getMessage()); } else { logger.warn("exception: {}", e.getCause()); } if(e.getChannel().isOpen()) { e.getChannel().close(); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { // handle the case of to big requests. if (e.getCause() instanceof TooLongFrameException) { DefaultHttpResponse response = new DefaultHttpResponse(HTTP_1_1, HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE); e.getChannel().write(response).addListener(ChannelFutureListener.CLOSE); } else { LogMessages.LOGGER.info(Messages.MESSAGES.exceptionCaught(), e.getCause()); e.getChannel().close(); } } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { LOG.error(e.getCause().getMessage(), e.getCause()); //if channel.close() is not called, never closed files in this request if (ctx.getChannel().isConnected()){ ctx.getChannel().close(); } } }
public void invalidRequestSent(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { Channel channel = ctx.getChannel(); if (channel == null || !channel.isOpen()) { log.debug("Not writing any response, channel is already closed.", e.getCause()); return; } final DefaultHttpResponse response = new DefaultHttpResponse(HttpVersion.HTTP_1_0, HttpResponseStatus.BAD_REQUEST); response.headers().add(HttpHeaders.Names.CONTENT_TYPE, "text/plain"); response.headers().add(HttpHeaders.Names.CONNECTION, "close"); final ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); new ChannelBufferOutputStream(buffer).writeBytes("Your client has sent a malformed or illegal request.\n"); response.setContent(buffer); final ChannelFuture channelFuture = channel.write(response); channelFuture.addListener(ChannelFutureListener.CLOSE); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { // Get the cause of the exception. Throwable t = e.getCause(); // A ClosedChannelException occurs if the client disconnects and is not // an error scenario. if (!(t instanceof ClosedChannelException)) { LOG.log(Level.SEVERE, "Error during processing for channel " + ctx.getChannel() + ".", t); } // We must stop sending to this client if any errors occur during // processing. e.getChannel().close(); }
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final ExceptionEvent e) { connectionHelper.fireConnectionException(e); final Channel channel = ctx.getChannel(); final Throwable cause = e.getCause(); if ( ! (cause instanceof IOException) ) { if ( channel.isOpen() ) { final NettyHttpResponse nettyHttpResponse = new NettyHttpResponse(ctx, new DefaultHttpResponse(HTTP_1_1, INTERNAL_SERVER_ERROR), true, exceptionHandler); executor.execute(new Runnable() { @Override public void run() { try { ctx.setAttachment(IGNORE_REQUEST); nettyHttpResponse.error(e.getCause()); } catch (Exception exception) { exceptionHandler.uncaughtException(Thread.currentThread(), WebbitException.fromException(exception, channel)); } } }); } else { exceptionHandler.uncaughtException( Thread.currentThread(), WebbitException.fromException(cause, channel) ); } } }
@Override 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; } else if (cause instanceof IOException) { if (cause instanceof ClosedChannelException) { LOG.debug("Ignoring closed channel error", cause); return; } String message = String.valueOf(cause.getMessage()); if (IGNORABLE_ERROR_MESSAGE.matcher(message).matches()) { LOG.debug("Ignoring client socket close", cause); return; } } LOG.error("Shuffle error: ", cause); if (ch.isConnected()) { LOG.error("Shuffle error " + e); sendError(ctx, INTERNAL_SERVER_ERROR); } } }
@Override public void exceptionCaught(ChannelHandlerContext context, ExceptionEvent event) { if (log.isDebugEnabled()) { final Throwable cause = event.getCause(); if (cause == null) { log.debug("[%s] Caught exception", requestDesc); } else { log.debug(cause, "[%s] Caught exception", requestDesc); } } retVal.setException(event.getCause()); // response is non-null if we received initial chunk and then exception occurs if (response != null) { handler.exceptionCaught(response, event.getCause()); } try { if (channel.isOpen()) { channel.close(); } } catch (Exception e) { log.warn(e, "Error while closing channel"); } finally { channelResourceContainer.returnResource(); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { logger.error("event=longpoll_sender_error remote_address=" + e.getChannel().getRemoteAddress(), e.getCause()); e.getChannel().close(); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) { disconnect(false, true, e.getCause()); }