private void errorIf(ClientResponse response,
            ClientResponse.Status[] status, boolean bool)
            throws ClientException {
        ClientResponse.Status clientResponseStatus
                = response.getClientResponseStatus();
        if (bool) {
            if (contains(status, clientResponseStatus)) {
                String message = response.getEntity(String.class);
                throw new ClientException(clientResponseStatus, message);
            }
        } else if (!contains(status, clientResponseStatus)) {
            String message = response.getEntity(String.class);
            throw new ClientException(clientResponseStatus, message);
        }
    }
private void errorIf ( ClientResponse response , ClientResponse . Status [ ] status , boolean bool ) throws ClientException { ClientResponse . Status clientResponseStatus = response . getClientResponseStatus ( ) ; if ( bool ) { if ( contains ( status , clientResponseStatus ) ) { String message = response . getEntity ( String . class ) ; throw new ClientException ( clientResponseStatus , message ) ; } } else if ( ! contains ( status , clientResponseStatus ) ) { String message = response . getEntity ( String . class ) ; throw new ClientException ( clientResponseStatus , message ) ; } }
If there is an unexpected status code, it gets the status message, closes
the response, and throws an exception.

@throws ClientException