public static <T> CompletableFuture<T> failedFuture(Throwable e) {
    CompletableFuture<T> future = new CompletableFuture<>();
    future.completeExceptionally(e);
    return future;
  }
Returns a CompletableFuture that is already completed exceptionally with the given exception.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/FutureUtils.java