private static <T> CompletableFuture<T> failureHandle(CompletableFuture<T> cf) {
        return cf.whenComplete((rst, ex) -> {
            if (ex != null) {
                ex = FutureUtil.cause(ex);
                if (ex instanceof NodeEpochExpiredException
                    || ex instanceof NodeEpochNotExistException
                    || ex instanceof NodeFencedException) {
                    LOGGER.error("The node is fenced, force shutdown the node", ex);
                    //noinspection CallToPrintStackTrace
                    ex.printStackTrace();
                    Runtime.getRuntime().halt(1);
                }
            }
        });
    }
Maybe halt and complete the waiting future if the exception is a ElasticStreamClientException with a halt error code.

@param t             the exception
@param waitingFuture the waiting future
@return true if the waiting future is completed, otherwise false
core/src/main/scala/kafka/log/streamaspect/ClientWrapper.java