public static void invokeExceptionCaughtNow(final HandlerContext ctx, final MessageEvent<?> event,
                                                final Throwable cause) {
        try {
            ctx.handler().exceptionCaught(ctx, event, cause);
        } catch (final Throwable t) {
            if (LOG.isWarnEnabled()) {
                LOG.warn("An exception was thrown by a user handler's exceptionCaught() method: {}.",
                    StackTraceUtil.stackTrace(t));
                LOG.warn(".. and the cause of the exceptionCaught() was: {}.", StackTraceUtil.stackTrace(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