这是我目前的代码:
WebTarget resource = client.target(restEndpointURL);
Response response = resource.request().delete();
if (response.getStatusInfo() != Status.OK) {
String message = String.format("some meaningful error message");
throw new WebApplicationException(message, response);
}
我想从此处抛出响应状态特定异常,而不是抛出通用WebApplicationException。