Skip to content

Commit 6d3ab19

Browse files
Refine BooleanEndpoint so that 4xx status codes other than 404 are considered as errors (#853) (#854)
Co-authored-by: Sylvain Wallez <sylvain@elastic.co>
1 parent 184174a commit 6d3ab19

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

Lines changed: 2 additions & 1 deletion
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)