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>
(cherry picked from commit 2fac82434b
)
This commit is contained in:
parent
3619024b44
commit
095cbd02e5
@ -152,7 +152,11 @@ public class APIClient {
|
||||
get(path, queryParams).delete();
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user