public static <T> T doAndThrow(final CheckedSupplier<T> supplier, final Function<Throwable, ? extends Exception> handler) throws Exception {
        try {
            return supplier.get();
        } catch (final Throwable e) {
            LoggingUtils.error(LOGGER, e);
            throw handler.apply(e);
        }
    }
Do and throw exception.

@param <T>      the type parameter
@param supplier the supplier
@param handler  the handler
@return the t
@throws Exception the exception
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/function/FunctionUtils.java