cookies=cookies.get_all(domain) if cookies.has(domain) else dict()
)
- logger.info("Parsing JSON response from domain='%s',path='%s' ...", domain, path)
+ logger.debug("Parsing JSON response from domain='%s',path='%s' ...", domain, path)
json_reply["json"] = json_from_response(response)
logger.debug("response.ok='%s',response.status_code=%d,json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
- if not response.ok or response.status_code >= 400:
+ if not response.ok or response.status_code >= 400 or len(json_reply["json"]) == 0:
logger.warning("Cannot query JSON API: domain='%s',path='%s',data()=%d,response.status_code=%d,json_reply[]='%s'", domain, path, len(data), response.status_code, type(json_reply))
json_reply["status_code"] = response.status_code
json_reply["error_message"] = response.reason
logger.debug("Fetching url='%s' ...", url)
response = utils.fetch_url(url, api_headers, timeout)
- logger.info("Parsing JSON response from url='%s' ...", url)
+ logger.debug("Parsing JSON response from url='%s' ...", url)
json_reply["json"] = json_from_response(response)
logger.debug("response.ok='%s',response.status_code='%s',json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
- if not response.ok or response.status_code >= 400:
+ if not response.ok or response.status_code >= 400 or len(json_reply["json"]) == 0:
logger.warning("Cannot query JSON API: url='%s',response.status_code=%d,json_reply[]='%s'", url, response.status_code, type(json_reply))
json_reply["status_code"] = response.status_code
json_reply["error_message"] = response.reason
instances.set_last_error(domain, exception)
raise exception
- logger.info("Parsing JSON response from domain='%s',path='%s' ...", domain, path)
+ logger.debug("Parsing JSON response from domain='%s',path='%s' ...", domain, path)
json_reply["json"] = json_from_response(response)
logger.debug("response.ok='%s',response.status_code=%d,json_reply[]='%s'", response.ok, response.status_code, type(json_reply))
- if not response.ok or response.status_code >= 400:
+ if not response.ok or response.status_code >= 400 or len(json_reply["json"]) == 0:
logger.warning("Cannot query JSON API: domain='%s',path='%s',response.status_code=%d,json_reply[]='%s'", domain, path, response.status_code, type(json_reply))
json_reply["status_code"] = response.status_code
json_reply["error_message"] = response.reason