protected RuntimeException runtimeException(final Exception exception) {
        if (exception instanceof RuntimeException runtimeException) {
            throw runtimeException;
        } else {
            throw new RuntimeException(exception);
        }
    }
Wrap an Exception into a RuntimeException.

@param exception the original exception
@return the RuntimeException
pac4j-core/src/main/java/org/pac4j/core/engine/AbstractExceptionAwareLogic.java