mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
重试工具新增获取异常原因等相关方法
This commit is contained in:
@@ -182,6 +182,7 @@ public class RetryableTask<T> {
|
||||
* 获取结果, 如果无法获取结果, 则抛出最后一次执行时的异常
|
||||
*
|
||||
* @return 结果
|
||||
* @throws Throwable 获取结果时, 如果无法获取结果, 则抛出最后一次执行时的异常
|
||||
*/
|
||||
public T orElseThrow() throws Throwable {
|
||||
return Optional.ofNullable(this.result).orElseThrow(() -> this.throwable().orElse(new RuntimeException()));
|
||||
|
Reference in New Issue
Block a user