- int status = response.getStatus();
- if (!HttpStatus.isSuccess(status)) {
- throw new HttpException(status, String.format("Failed to get response from the server. Info: %s",
+ if (response.getStatusInfo().getFamily() != Response.Status.Family.SUCCESSFUL) {
+ throw new HttpException(response.getStatus(), String.format("Failed to get response from the server. Info: %s",