public static <R> R doAndHandle(final CheckedSupplier<R> function) {
        try {
            return function.get();
        } catch (final InvalidTicketException e) {
            LOGGER.debug(e.getMessage(), e);
        } catch (final Throwable e) {
            LoggingUtils.warn(LOGGER, e);
        }
        return null;
    }
Do and handle.

@param <R>      the type parameter
@param function the function
@return the r
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/function/FunctionUtils.java