示例#1
0
 def _checkResponseStatus(self, response):
     """
     Checks the speficied HTTP response from the requests package and
     raises an exception if a non-200 HTTP code was returned by the
     server.
     """
     if response.status_code != requests.codes.ok:
         self._logger.error("%s %s", response.status_code, response.text)
         raise exceptions.RequestNonSuccessException(
             "Url {0} had status_code {1}".format(
                 response.url, response.status_code))
示例#2
0
 def _checkStatus(self, response):
     if response.status_code != requests.codes.ok:
         self._logger.error("%s %s", response.status_code, response.text)
         raise exceptions.RequestNonSuccessException(
             "Url {0} had status_code {1}".format(response.url,
                                                  response.status_code))