protected function checkResponse(Response $response)
    {
        $status = $response->getStatusCode();
        $reason = $response->getReasonPhrase();
        switch ($status) {
            case '403':
                throw new Exceptions\GeocodioAuthError($reason);
                break;

            case '422':
                throw new Exceptions\GeocodioDataError($reason);
                break;

            case '500':
                throw new Exceptions\GeocodioServerError($reason);
                break;

            case '200':
                return $response;
                break;

            default:
                throw new Exceptions\GeocodioException("There was a problem with your request - $reason");
                break;
        }
    }
protected function checkResponse(Response $response)
    {
        $status = $response->getStatusCode();
        $reason = $response->getReasonPhrase();
        switch ($status) {
            case '403':
                throw new Exceptions\GeocodioAuthError($reason);
                break;

            case '422':
                throw new Exceptions\GeocodioDataError($reason);
                break;

            case '500':
                throw new Exceptions\GeocodioServerError($reason);
                break;

            case '200':
                return $response;
                break;

            default:
                throw new Exceptions\GeocodioException("There was a problem with your request - $reason");
                break;
        }
    }
protected function checkResponse ( Response $ response ) { $ status = $ response -> getStatusCode ( ) ; $ reason = $ response -> getReasonPhrase ( ) ; switch ( $ status ) { case '403' : throw new Exceptions \ GeocodioAuthError ( $ reason ) ; break ; case '422' : throw new Exceptions \ GeocodioDataError ( $ reason ) ; break ; case '500' : throw new Exceptions \ GeocodioServerError ( $ reason ) ; break ; case '200' : return $ response ; break ; default : throw new Exceptions \ GeocodioException ( "There was a problem with your request - $reason" ) ; break ; } }
Check response code and throw appropriate exception

@param  GuzzleHttp\Psr7\Response $response Guzzle Response
@return mixed
Check response code and throw appropriate exception