Skip to content

Commit eb34841

Browse files
committed
fix: deliver projection validation error via exceptional completion
Match how server-side failures of the same condition surface; keep the public CompletableFuture API free of synchronous throws.
1 parent 35285d2 commit eb34841

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/io/kurrent/dbclient/CreateProjection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ public CreateProjection(final GrpcClient client, final String projectionName, fi
3030
@SuppressWarnings("unchecked")
3131
public CompletableFuture execute() {
3232
if (engineVersion == 2 && trackEmittedStreams) {
33-
throw new IllegalArgumentException(
34-
"trackEmittedStreams is not supported when engineVersion is 2 (V2)");
33+
CompletableFuture<Projectionmanagement.CreateResp> failed = new CompletableFuture<>();
34+
failed.completeExceptionally(new IllegalArgumentException(
35+
"trackEmittedStreams is not supported when engineVersion is 2 (V2)"));
36+
return failed;
3537
}
3638

3739
return this.client.run(channel -> {

0 commit comments

Comments
 (0)