Skip to content

Commit

Permalink
Merge pull request #106 from justinstoller/timeout-errors
Browse files Browse the repository at this point in the history
(PE-39731) Log request info on failure or cancellation
  • Loading branch information
justinstoller authored Jan 8, 2025
2 parents 89dc1ce + 898ccc0 commit 12b4712
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/java/com/puppetlabs/http/client/impl/JavaClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ private static void completeResponse(ResponseDeliveryDelegate responseDeliveryDe
contentType,
callback);
} catch (Exception e) {
LOGGER.error("Processing successful request to {} raised '{}'", requestOptions.getUri().toString(), e.getMessage());
responseDeliveryDelegate.deliverResponse(requestOptions, e, callback);
}
}
Expand Down Expand Up @@ -479,11 +480,13 @@ public void completed(HttpResponse httpResponse) {

@Override
public void failed(Exception e) {
LOGGER.error("{} request to '{}' failed.", method.toString(), requestOptions.getUri().toString());
responseDeliveryDelegate.deliverResponse(requestOptions, e, callback);
}

@Override
public void cancelled() {
LOGGER.error("{} request to '{}' cancelled.", method.toString(), requestOptions.getUri().toString());
responseDeliveryDelegate.deliverResponse(requestOptions,
new HttpClientException("Request cancelled"),
callback);
Expand Down

0 comments on commit 12b4712

Please sign in to comment.