diff --git a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java index 2d7940b4a893c..f0d4063a6e0d5 100644 --- a/client/rest/src/main/java/org/elasticsearch/client/RestClient.java +++ b/client/rest/src/main/java/org/elasticsearch/client/RestClient.java @@ -577,7 +577,7 @@ private void retryIfPossible(Exception exception) { long timeout = maxRetryTimeoutMillis - timeElapsedMillis; if (timeout <= 0) { IOException retryTimeoutException = new IOException( - "request retries exceeded max retry timeout [" + maxRetryTimeoutMillis + "]"); + "request retries exceeded max retry timeout [" + maxRetryTimeoutMillis + "]", exception); listener.onDefinitiveFailure(retryTimeoutException); } else { listener.trackFailure(exception);