code: @SuppressWarnings("unchecked")
      public static <T, E extends Throwable> void exceptionListener(CompletableFuture<T> completableFuture, Class<E> exceptionClass, Consumer<E> exceptionListener) {
          completableFuture.whenComplete((r, ex) -> {
              if (ex != null && exceptionClass.isAssignableFrom(ex.getClass())) {
                  Callbacks.invokeSafely(exceptionListener, (E) ex, null);
              }
          });
      }
docs: Registers an exception listener to the given CompletableFuture for a particular type of exception.
  
  @param completableFuture The Future to register to.
  @param exceptionClass    The type of exception to listen to.
  @param exceptionListener The Listener to register.
  @param <T>               The Type of the future's result.
  @param <E>               The Type of the exception.