code: @SneakyThrows
      public static <T, R> Function<T, R> doAndHandle(final CheckedFunction<T, R> function, final CheckedFunction<Throwable, R> errorHandler) {
          return t -> {
              try {
                  return function.apply(t);
              } catch (final Throwable e) {
                  LOGGER.warn(e.getMessage(), e);
                  try {
                      return errorHandler.apply(e);
                  } catch (final Throwable ex) {
                      throw new IllegalArgumentException(ex.getMessage());
                  }
              }
          };
      }
docs: Default function function.
  
  @param <T>          the type parameter
  @param <R>          the type parameter
  @param function     the function
  @param errorHandler the error handler
  @return the function