Skip to content

Commit 71f2500

Browse files
committed
Bump version
1 parent ecd47ac commit 71f2500

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

config/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.17.19
1+
7.17.20

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
package co.elastic.clients.elasticsearch._types;
2121

22+
import co.elastic.clients.transport.http.TransportHttpClient;
23+
2224
import javax.annotation.Nullable;
2325

2426
/**
@@ -33,11 +35,19 @@ public class ElasticsearchException extends RuntimeException {
3335

3436
private final ErrorResponse response;
3537
private final String endpointId;
38+
@Nullable
39+
private final TransportHttpClient.Response httpResponse;
3640

37-
public ElasticsearchException(String endpointId, ErrorResponse response) {
41+
public ElasticsearchException(String endpointId, ErrorResponse response,
42+
@Nullable TransportHttpClient.Response httpResponse) {
3843
super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason());
3944
this.response = response;
4045
this.endpointId = endpointId;
46+
this.httpResponse = httpResponse;
47+
}
48+
49+
public ElasticsearchException(String endpointId, ErrorResponse response) {
50+
this(endpointId, response, null);
4151
}
4252

4353
/**
@@ -68,4 +78,12 @@ public ErrorCause error() {
6878
public int status() {
6979
return this.response.status();
7080
}
81+
82+
/**
83+
* The underlying http response, if available.
84+
*/
85+
@Nullable
86+
public TransportHttpClient.Response httpResponse() {
87+
return this.httpResponse;
88+
}
7189
}

0 commit comments

Comments
 (0)