protected function checkErrors($response)
    {
        $body = $response->body;
        $httpStatusCode = $response->status_code;

        try
        {
            $body = json_decode($response->body, true);
        }
        catch (Exception $e)
        {
            $this->throwServerError($body, $httpStatusCode);
        }

        if (($httpStatusCode < 200) or
            ($httpStatusCode >= 300))
        {
            $this->processError($body, $httpStatusCode, $response);
        }
    }
protected function checkErrors($response)
    {
        $body = $response->body;
        $httpStatusCode = $response->status_code;

        try
        {
            $body = json_decode($response->body, true);
        }
        catch (Exception $e)
        {
            $this->throwServerError($body, $httpStatusCode);
        }

        if (($httpStatusCode < 200) or
            ($httpStatusCode >= 300))
        {
            $this->processError($body, $httpStatusCode, $response);
        }
    }
protected function checkErrors ( $ response ) { $ body = $ response -> body ; $ httpStatusCode = $ response -> status_code ; try { $ body = json_decode ( $ response -> body , true ) ; } catch ( Exception $ e ) { $ this -> throwServerError ( $ body , $ httpStatusCode ) ; } if ( ( $ httpStatusCode < 200 ) or ( $ httpStatusCode >= 300 ) ) { $ this -> processError ( $ body , $ httpStatusCode , $ response ) ; } }
Process the statusCode of the response and throw exception if necessary
@param Object $response The response object returned by Requests
Process the statusCode of the response and throw exception if necessary