Skip to content

Commit f28bcd5

Browse files
authored
Refine BooleanEndpoint so that 4xx status codes other than 404 are considered as errors (#853)
1 parent 1b972de commit f28bcd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java-client/src/main/java/co/elastic/clients/transport/endpoints/BooleanEndpoint.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public BooleanEndpoint(
4141

4242
@Override
4343
public boolean isError(int statusCode) {
44-
return statusCode >= 500;
44+
// 404 indicates a 'false' result.
45+
return statusCode != 404 && super.isError(statusCode);
4546
}
4647

4748
public boolean getResult(int statusCode) {

0 commit comments

Comments
 (0)