aboutsummaryrefslogtreecommitdiffstats
path: root/jaxrs_client_utils
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-09-30 14:02:47 +0200
committerHarald Musum <musum@verizonmedia.com>2020-09-30 14:02:47 +0200
commitef5e1c21e2196c7842f14223ed124416647e7219 (patch)
treeb72f75dee3a0b7228f118437880a57de9e892761 /jaxrs_client_utils
parentff205ce5e2eccafeb0957007fb2671f1488e57c3 (diff)
Add uri to log and exception message
Diffstat (limited to 'jaxrs_client_utils')
-rw-r--r--jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java b/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java
index f51026382fc..9faaa1ae5b9 100644
--- a/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java
+++ b/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java
@@ -29,7 +29,7 @@ public class RetryingJaxRsStrategy<T> implements JaxRsStrategy<T> {
private final int port;
private final JaxRsClientFactory jaxRsClientFactory;
private final Class<T> apiClass;
- private String pathPrefix;
+ private final String pathPrefix;
private final String scheme;
private int maxIterations = 2;
@@ -88,10 +88,9 @@ public class RetryingJaxRsStrategy<T> implements JaxRsStrategy<T> {
} catch (ProcessingException | ServiceUnavailableException e) {
// E.g. java.net.SocketTimeoutException thrown on read timeout is wrapped as a ProcessingException,
// while ServiceUnavailableException is a WebApplicationException
- sampleException = e;
- logger.log(Level.INFO, "Failed REST API call to "
- + hostName + ":" + port + pathPrefix + " (in retry loop): "
- + e.getMessage());
+ String message = "Failed REST API call to " + uri + " (in retry loop):";
+ sampleException = new RuntimeException(message, e);
+ logger.log(Level.INFO, message + e.getMessage());
}
}
}