Skip to content

Commit 886e670

Browse files
add cause to elasticsearch exception message (#1213) (#1214)
Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
1 parent 16ac5e1 commit 886e670

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class ElasticsearchException extends RuntimeException {
4040

4141
public ElasticsearchException(String endpointId, ErrorResponse response,
4242
@Nullable TransportHttpClient.Response httpResponse) {
43-
super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason());
43+
super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason() + (response.error().causedBy() != null ? " - " + response.error().causedBy().reason() : null));
4444
this.response = response;
4545
this.endpointId = endpointId;
4646
this.httpResponse = httpResponse;

0 commit comments

Comments
 (0)