From 8e533c6a444a1832263fc0ef5a26ceefc41c1e22 Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Tue, 21 Apr 2026 17:16:18 +0200 Subject: [PATCH] add cause to elasticsearch exception message (#1213) --- .../clients/elasticsearch/_types/ElasticsearchException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java index bad5ca1067..8694192498 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java @@ -40,7 +40,7 @@ public class ElasticsearchException extends RuntimeException { public ElasticsearchException(String endpointId, ErrorResponse response, @Nullable TransportHttpClient.Response httpResponse) { - super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason()); + super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason() + (response.error().causedBy() != null ? " - " + response.error().causedBy().reason() : null)); this.response = response; this.endpointId = endpointId; this.httpResponse = httpResponse;