Here is my current code:
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);
}
I want to throw response status specific exception from here instead of throwing generic WebApplicationException.