19
19
20
20
package co .elastic .clients .elasticsearch ._types ;
21
21
22
- import co .elastic .clients .transport .http .TransportHttpClient ;
23
-
24
22
import javax .annotation .Nullable ;
25
23
26
24
/**
@@ -35,19 +33,11 @@ public class ElasticsearchException extends RuntimeException {
35
33
36
34
private final ErrorResponse response ;
37
35
private final String endpointId ;
38
- @ Nullable
39
- private final TransportHttpClient .Response httpResponse ;
40
36
41
- public ElasticsearchException (String endpointId , ErrorResponse response ,
42
- @ Nullable TransportHttpClient .Response httpResponse ) {
37
+ public ElasticsearchException (String endpointId , ErrorResponse response ) {
43
38
super ("[" + endpointId + "] failed: [" + response .error ().type () + "] " + response .error ().reason ());
44
39
this .response = response ;
45
40
this .endpointId = endpointId ;
46
- this .httpResponse = httpResponse ;
47
- }
48
-
49
- public ElasticsearchException (String endpointId , ErrorResponse response ) {
50
- this (endpointId , response , null );
51
41
}
52
42
53
43
/**
@@ -78,12 +68,4 @@ public ErrorCause error() {
78
68
public int status () {
79
69
return this .response .status ();
80
70
}
81
-
82
- /**
83
- * The underlying http response, if available.
84
- */
85
- @ Nullable
86
- public TransportHttpClient .Response httpResponse () {
87
- return this .httpResponse ;
88
- }
89
71
}
0 commit comments