Skip to content

Commit 3e8ac9c

Browse files
committed
Making the Subscribers use a common base class- fail the overall CF onError
1 parent 8a64483 commit 3e8ac9c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/dataloader/DataLoaderHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ public synchronized void onError(Throwable ex) {
746746
// clear any cached view of this key because they all failed
747747
dataLoader.clear(key);
748748
}
749+
valuesFuture.completeExceptionally(ex);
749750
}
750751

751752
}
@@ -763,7 +764,7 @@ private DataLoaderMapEntrySubscriber(
763764
List<Object> callContexts,
764765
List<CompletableFuture<V>> queuedFutures
765766
) {
766-
super(valuesFuture,keys,callContexts,queuedFutures);
767+
super(valuesFuture, keys, callContexts, queuedFutures);
767768
this.callContextByKey = new HashMap<>();
768769
this.queuedFutureByKey = new HashMap<>();
769770
for (int idx = 0; idx < queuedFutures.size(); idx++) {
@@ -817,6 +818,8 @@ public synchronized void onError(Throwable ex) {
817818
dataLoader.clear(key);
818819
}
819820
}
821+
valuesFuture.completeExceptionally(ex);
820822
}
823+
821824
}
822825
}

0 commit comments

Comments
 (0)