/** * Checks ReST response for errors. * * @param Response $response the ReST response * @return void * @throws Exception\RuntimeException * @access protected */ protected static function checkResponse(HttpResponse $response) { if ($response->isServerError() || $response->isClientError()) { throw new Exception\RuntimeException(sprintf('Invalid response status code (HTTP/%s %s %s)', $response->getVersion(), $response->getStatus(), $response->getMessage())); } }