public R apply(final T t) throws Exception { while (true) { try { return getUserFunction().apply(t); } catch (Exception e) { if (retryStrategy.shouldRetry()) { log.info(retryStrategy.retryMessage()); } else { log.info(retryStrategy.retryMessage()); throw e; } } } }