do not treat failed requests as erros in site_api
This commit is contained in:
parent
301cfe10e8
commit
fb645b47b4
1 changed files with 2 additions and 2 deletions
|
@ -22,10 +22,10 @@ def get(url, refresh=False) -> Optional[Dict | str]:
|
|||
logger.debug("GET {} (force_refresh={})".format(query, refresh))
|
||||
response = session.get(query, force_refresh=refresh)
|
||||
if not response:
|
||||
logger.error("Failed to get request {} from hanab.live".format(query))
|
||||
logger.debug("Failed to get request {} from hanab.live".format(query))
|
||||
return None
|
||||
if not response.status_code == 200:
|
||||
logger.error("Request {} from hanab.live produced status code {}".format(query, response.status_code))
|
||||
logger.debug("Request {} from hanab.live produced status code {}".format(query, response.status_code))
|
||||
return None
|
||||
if "application/json" in response.headers['content-type']:
|
||||
return json.loads(response.text)
|
||||
|
|
Loading…
Reference in a new issue