APIClient: delete command should check for errors
delete commands do not return a value, still, it is possible that the command will return a value different than OK. In such a case, the error should be propagate to the caller via an exception. Fixes #65 Signed-off-by: Amnon Heiman <amnon@scylladb.com> Message-Id: <20190618135312.2776-1-amnon@scylladb.com>
This commit is contained in:
parent
eda6f4e1a8
commit
2fac82434b
@ -152,7 +152,11 @@ public class APIClient {
|
|||||||
get(path, queryParams).delete();
|
get(path, queryParams).delete();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
get(path).delete();
|
Response response = get(path).delete();
|
||||||
|
if (response.getStatus() != Response.Status.OK.getStatusCode()) {
|
||||||
|
throw getException("Scylla API server HTTP delete to URL '" + path + "' failed",
|
||||||
|
response.readEntity(String.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(String path) {
|
public void delete(String path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user