DeleteResponse response = resolveApitraryClient().send(request);
if (HttpStatus.OK.ordinal() != response.getStatusCode()) {
if (HttpStatus.Not_Found.ordinal() == response.getStatusCode()) {
throw new ApitraryOrmDeleteException("Object with id " + id + " does not exist.");
} else {
String statusMessage = (String) new DeleteResponseUnmarshaller().unMarshall(response, entity);
throw new ApitraryOrmDeleteException(statusMessage);
}
}
}