public final T retryIfNot()

in common/src/main/java/org/apache/cassandra/diff/RetryStrategy.java [47:66]


    public final <T> T retryIfNot(Callable<T> retryable, Class<? extends Exception>... excludedExceptions) throws Exception {
        Function<Exception, Boolean> containsException = ex -> {
            for (Class<? extends Exception> xClass : excludedExceptions) {
                if (xClass.isInstance(ex))
                    return true;
            }
            return false;
        };
        while (true) {
            try {
                return retryable.call();
            }
            catch (Exception exception) {
                if (containsException.apply(exception) || !shouldRetry()) {
                    throw exception;
                }
                logger.warn("Retry with " + toString());
            }
        }
    }