From 898ccc01fede37c174dc49bf6caa4a07b0f02ec1 Mon Sep 17 00:00:00 2001 From: Justin Stoller Date: Mon, 23 Dec 2024 08:39:17 -0800 Subject: [PATCH] (PE-39731) Log request info on failure or cancellation --- src/java/com/puppetlabs/http/client/impl/JavaClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/java/com/puppetlabs/http/client/impl/JavaClient.java b/src/java/com/puppetlabs/http/client/impl/JavaClient.java index 839393b..ec56ce4 100644 --- a/src/java/com/puppetlabs/http/client/impl/JavaClient.java +++ b/src/java/com/puppetlabs/http/client/impl/JavaClient.java @@ -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); } } @@ -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);