Skip to content

Commit f62cc7c

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

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
@@ -39,7 +39,8 @@ public BooleanEndpoint(
3939

4040
@Override
4141
public boolean isError(int statusCode) {
42-
return statusCode >= 500;
42+
// 404 indicates a 'false' result.
43+
return statusCode != 404 && super.isError(statusCode);
4344
}
4445

4546
public boolean getResult(int statusCode) {

0 commit comments

Comments
 (0)