Skip to content

Commit

Permalink
Implement onFailure to complete the asyncResponse future.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBarker committed Jul 26, 2024
1 parent eea7fc1 commit 2db6a92
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public void onComplete(Result result) {
}
}

@Override
public void onFailure(Response response, Throwable failure) {
asyncResponse.completeExceptionally(failure);
}

public CompletableFuture<HttpResponse<AsyncBody>> listen(Request request) {
request.send(this);
return asyncResponse.thenApply(HttpResponse.class::cast);
Expand Down

0 comments on commit 2db6a92

Please sign in to comment.