fixed bug in post request

This commit is contained in:
Hellow2 2023-03-31 10:56:31 +02:00
parent 3aa6faab51
commit be48707623

View File

@ -67,10 +67,13 @@ class Page:
r = cls.API_SESSION.post(url, json=json, timeout=cls.TIMEOUT) r = cls.API_SESSION.post(url, json=json, timeout=cls.TIMEOUT)
except requests.exceptions.Timeout: except requests.exceptions.Timeout:
retry = True retry = True
except requests.exceptions.ConnectionError:
retry = True
if not retry and r.status_code in accepted_response_codes: if not retry and r.status_code in accepted_response_codes:
return r return r
if not retry:
LOGGER.warning(f"{cls.__name__} responded wit {r.status_code} at POST:{url}. ({trie}-{cls.TRIES})") LOGGER.warning(f"{cls.__name__} responded wit {r.status_code} at POST:{url}. ({trie}-{cls.TRIES})")
LOGGER.debug(r.content) LOGGER.debug(r.content)