protected function checkResponse(ResponseInterface $response)
    {
        if ($response->getStatusCode() >= 400) {
            $message = sprintf(
                "Something went wrong when calling Vault (%s - %s)\n%s.",
                $response->getStatusCode(),
                $response->getReasonPhrase(),
                $response->getBody()->getContents()
            );

            if ($response->getStatusCode() >= 500) {
                throw new ServerException($message, $response->getStatusCode(), $response);
            }

            throw new ClientException($message, $response->getStatusCode(), $response);
        }
    }
protected function checkResponse(ResponseInterface $response)
    {
        if ($response->getStatusCode() >= 400) {
            $message = sprintf(
                "Something went wrong when calling Vault (%s - %s)\n%s.",
                $response->getStatusCode(),
                $response->getReasonPhrase(),
                $response->getBody()->getContents()
            );

            if ($response->getStatusCode() >= 500) {
                throw new ServerException($message, $response->getStatusCode(), $response);
            }

            throw new ClientException($message, $response->getStatusCode(), $response);
        }
    }
protected function checkResponse ( ResponseInterface $ response ) { if ( $ response -> getStatusCode ( ) >= 400 ) { $ message = sprintf ( "Something went wrong when calling Vault (%s - %s)\n%s." , $ response -> getStatusCode ( ) , $ response -> getReasonPhrase ( ) , $ response -> getBody ( ) -> getContents ( ) ) ; if ( $ response -> getStatusCode ( ) >= 500 ) { throw new ServerException ( $ message , $ response -> getStatusCode ( ) , $ response ) ; } throw new ClientException ( $ message , $ response -> getStatusCode ( ) , $ response ) ; } }
Returns true whenever request should be retried.

@param ResponseInterface $response

@throws \Vault\Exceptions\ClientException
@throws \Vault\Exceptions\ServerException
Returns true whenever request should be retried .