Skip to content

Commit

Permalink
Consume all params and content on extension Rest Request exception (o…
Browse files Browse the repository at this point in the history
…pensearch-project#8096)

Signed-off-by: Daniel Widdis <widdis@gmail.com>
  • Loading branch information
dbwiddis committed Jun 20, 2023
1 parent 40d7583 commit 1f6a3bc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ public void handleResponse(RestExecuteOnExtensionResponse response) {
@Override
public void handleException(TransportException exp) {
logger.debug("REST request failed", exp);
// On failure the original request params and content aren't consumed
// which gives misleading error messages, so we just consume them here
request.params().keySet().stream().forEach(p -> request.param(p));
request.content();
inProgressFuture.completeExceptionally(exp);
}

Expand Down

0 comments on commit 1f6a3bc

Please sign in to comment.