diff --git a/nop-api-core/src/main/java/io/nop/api/core/util/FutureHelper.java b/nop-api-core/src/main/java/io/nop/api/core/util/FutureHelper.java index 43aa47b91..ada787e9e 100644 --- a/nop-api-core/src/main/java/io/nop/api/core/util/FutureHelper.java +++ b/nop-api-core/src/main/java/io/nop/api/core/util/FutureHelper.java @@ -439,7 +439,10 @@ private static boolean isSuccess(CompletionStage f) { public static boolean isError(CompletionStage f) { if (f instanceof ResolvedPromise) return ((ResolvedPromise) f).getException() != null; - return true; + if (f instanceof CompletableFuture) { + return ((CompletableFuture) f).isCompletedExceptionally(); + } + return false; } public static CompletableFuture waitAnySuccess(Collection futures) {