我想从 FailSafe 方法中抛出异常 (Jodah)
return Failsafe.with(RetryPolicyProvider.HttpRetryPolicy.onRetry(e -> LOGGER.info("Retrying ", e.getAttemptCount(), tableName, messageId)))
.with(executor)
.getAsync(() -> this.httpClient.postRequestWithGZipHeader(url, batchRequestPayload))
.thenApply(response -> {
try {
// Do Something}
}
catch (Exception e) {
throw new Exception("Exc thrown!")}
})
..
但似乎不可能从 Failsafe Jodah 方法中抛出这样的异常。怎么做?