@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (cause instanceof Http2Exception) { Http2Exception h2e = (Http2Exception) cause; if (h2e.error() == Http2Error.NO_ERROR && Http2Exception.ShutdownHint.GRACEFUL_SHUTDOWN.equals(h2e.shutdownHint())) { // This is the exception we threw ourselves to make the http2 codec gracefully close the connection. So just // swallow it so that it doesn't propagate and get logged. } else { super.exceptionCaught(ctx, cause); } } else if (cause instanceof Errors.NativeIoException) { LOG.debug("SwallowHttp2ExceptionShutdownHint, NativeIoException " + cause); Http2ConnectionCloseHandler.incrementExceptionCounter(cause); } else { LOG.debug("SwallowHttp2ExceptionShutdownHint unknown exception " + cause); if (!SWALLOW_UNKNOWN_EXCEPTIONS_ON_CONN_CLOSE.get()) { super.exceptionCaught(ctx, cause); } } } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (cause instanceof Http2Exception) { Http2Exception h2e = (Http2Exception) cause; if (h2e.error() == Http2Error.NO_ERROR && Http2Exception.ShutdownHint.GRACEFUL_SHUTDOWN.equals(h2e.shutdownHint())) { // This is the exception we threw ourselves to make the http2 codec gracefully close the connection. So just // swallow it so that it doesn't propagate and get logged. } else { super.exceptionCaught(ctx, cause); } } else if (cause instanceof Errors.NativeIoException) { LOG.debug("SwallowHttp2ExceptionShutdownHint, NativeIoException " + cause); Http2ConnectionCloseHandler.incrementExceptionCounter(cause); } else { LOG.debug("SwallowHttp2ExceptionShutdownHint unknown exception " + cause); if (!SWALLOW_UNKNOWN_EXCEPTIONS_ON_CONN_CLOSE.get()) { super.exceptionCaught(ctx, cause); } } } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { if (cause instanceof Http2Exception) { Http2Exception h2e = (Http2Exception) cause; if (h2e.error() == Http2Error.NO_ERROR && Http2Exception.ShutdownHint.GRACEFUL_SHUTDOWN.equals(h2e.shutdownHint())) { // This is the exception we threw ourselves to make the http2 codec gracefully close the connection. So just // swallow it so that it doesn't propagate and get logged. } else { super.exceptionCaught(ctx, cause); } } else if (cause instanceof Errors.NativeIoException) { LOG.debug("SwallowHttp2ExceptionShutdownHint, NativeIoException " + cause); Http2ConnectionCloseHandler.incrementExceptionCounter(cause); } else { LOG.debug("SwallowHttp2ExceptionShutdownHint unknown exception " + cause); if (!SWALLOW_UNKNOWN_EXCEPTIONS_ON_CONN_CLOSE.get()) { super.exceptionCaught(ctx, cause); } } } }