/** * Throw the Attempt's exception, if it has one, wrapped in a RetryException. Otherwise, * return the attempt's result. * * @param attempt An attempt that was made by invoking the call * @param <T> The type of the attempt * @return The result of the attempt * @throws RetryException If the attempt has an exception */ private <T> T getOrThrow(Attempt<T> attempt) throws RetryException { if (attempt.hasException()) { throw new RetryException(attempt); } return attempt.get(); }
throw new RetryException(attemptNumber, attempt); } else { long sleepTime = waitStrategy.computeSleepTime(attempt); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RetryException(attemptNumber, attempt);
throw new RetryException(attempt); } else { long sleepTime = waitStrategy.computeSleepTime(attempt);