exceptionCaught(ctx, (ExceptionEvent) e); } else { ctx.sendUpstream(e);
@Override public void exceptionCaught(final ChannelHandlerContext ctx, final ExceptionEvent evt) throws Exception { super.exceptionCaught(ctx, evt); s_logger.log(Level.WARNING, "Handler raised exception", evt.getCause()); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { super.exceptionCaught(ctx, e); logger.error("exceptionCaught", e.getCause()); }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { final String connectionClosedMsg = "An existing connection was forcibly closed by the remote host"; final Throwable t = e.getCause(); if (t instanceof IOException && t.getMessage().equalsIgnoreCase(connectionClosedMsg)) { logger.debug("Unexpected close (may be safe to ignore)."); } else { super.exceptionCaught(ctx, e); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { boolean isSilent = sessionCallback.onError(e.getCause()); if (!isSilent) { super.exceptionCaught(ctx, e); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { // avoid stack overflow when exception happens on close if (TRUE != ctx.getAttachment()) { ctx.setAttachment(TRUE); // close channel and avoid warning logged by default exceptionCaught implementation Channel channel = ctx.getChannel(); channel.close(); } else { // log exception during close super.exceptionCaught(ctx, e); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { // FIXME: Move to BaseTransport if (e.getCause() instanceof SessionHandler.NotFoundException) { BaseTransport.respond(e.getChannel(), HttpResponseStatus.NOT_FOUND, "Session not found."); } else if (e.getCause() instanceof SessionHandler.LockException) { if (e.getChannel().isWritable()) { e.getChannel().write(Frame.closeFrame(2010, "Another connection still open")); } } else if (e.getCause() instanceof JsonParseException || e.getCause() instanceof JsonMappingException) { //NotFoundHandler.respond(e.getChannel(), HttpResponseStatus.INTERNAL_SERVER_ERROR, "Broken JSON encoding."); e.getChannel().close(); } else if (e.getCause() instanceof WebSocketHandshakeException) { if (e.getCause().getMessage().contains("missing upgrade")) { BaseTransport.respond(e.getChannel(), HttpResponseStatus.BAD_REQUEST, "Can \"Upgrade\" only to \"WebSocket\"."); } } else { super.exceptionCaught(ctx, e); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { // FIXME: Move to BaseTransport if (e.getCause() instanceof SessionHandler.NotFoundException) { BaseTransport.respond(e.getChannel(), HttpResponseStatus.NOT_FOUND, "Session not found."); } else if (e.getCause() instanceof SessionHandler.LockException) { if (e.getChannel().isWritable()) { e.getChannel().write(Frame.closeFrame(2010, "Another connection still open")); } } else if (e.getCause() instanceof JsonParseException || e.getCause() instanceof JsonMappingException) { //NotFoundHandler.respond(e.getChannel(), HttpResponseStatus.INTERNAL_SERVER_ERROR, "Broken JSON encoding."); e.getChannel().close(); } else if (e.getCause() instanceof WebSocketHandshakeException) { if (e.getCause().getMessage().contains("missing upgrade")) { BaseTransport.respond(e.getChannel(), HttpResponseStatus.BAD_REQUEST, "Can \"Upgrade\" only to \"WebSocket\"."); } //NotFoundHandler.respond(e.getChannel(), HttpResponseStatus.INTERNAL_SERVER_ERROR, "Broken JSON encoding."); //e.getChannel().close(); } else { super.exceptionCaught(ctx, e); } }