Skip to content

Commit

Permalink
watcher: Register Exception Handler before watch request
Browse files Browse the repository at this point in the history
Signed-off-by: Giri Ramasamy <46867712+giri-vsr@users.noreply.github.com>
  • Loading branch information
0x01F4 committed Dec 14, 2023
1 parent e3c0a46 commit 03546b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commonsIo = "2.15.1"
commonCompress = "1.25.0"
autoService = "1.1.1"
errorprone = "2.23.0"
vertx = "4.5.0"
vertx = "4.5.1"
picocli = "4.7.5"
restAssured = "5.3.2"

Expand Down
5 changes: 2 additions & 3 deletions jetcd-core/src/main/java/io/etcd/jetcd/impl/WatchImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,12 @@ void resume() {
builder.addFilters(WatchCreateRequest.FilterType.NOPUT);
}

rstream = Util.applyRequireLeader(option.withRequireLeader(), stub).watch(stream -> {
rstream = Util.applyRequireLeader(option.withRequireLeader(), stub).watchWithExceptionHandler(stream -> {
wstream.set(stream);
stream.write(WatchRequest.newBuilder().setCreateRequest(builder).build());
});
}, this::onError);

rstream.handler(this::onNext);
rstream.exceptionHandler(this::onError);
rstream.endHandler(event -> onCompleted());
}
}
Expand Down

0 comments on commit 03546b5

Please sign in to comment.