private static void notifyHandlerException(final HandlerContext ctx, final MessageEvent<?> event,
                                               final Throwable cause) {
        if (inExceptionCaught(cause)) {
            if (LOG.isWarnEnabled()) {
                LOG.warn("An exception was thrown by a user handler " + "while handling an exceptionCaught event: {}.",
                    StackTraceUtil.stackTrace(cause));
            }
            return;
        }

        invokeExceptionCaughtNow(ctx, event, cause);
    }
Most of the code references the pipeline design of
<a href="https://github.com/netty/netty">Netty</a>.

@author jiachun.fjc
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/pipeline/HandlerInvokerUtil.java