From be487076230dba98312f5c4218a38d854be87b97 Mon Sep 17 00:00:00 2001 From: Hellow2 Date: Fri, 31 Mar 2023 10:56:31 +0200 Subject: [PATCH] fixed bug in post request --- src/music_kraken/pages/abstract.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/music_kraken/pages/abstract.py b/src/music_kraken/pages/abstract.py index 8d0205f..5d573fb 100644 --- a/src/music_kraken/pages/abstract.py +++ b/src/music_kraken/pages/abstract.py @@ -67,12 +67,15 @@ class Page: r = cls.API_SESSION.post(url, json=json, timeout=cls.TIMEOUT) except requests.exceptions.Timeout: retry = True + except requests.exceptions.ConnectionError: + retry = True if not retry and r.status_code in accepted_response_codes: return r - LOGGER.warning(f"{cls.__name__} responded wit {r.status_code} at POST:{url}. ({trie}-{cls.TRIES})") - LOGGER.debug(r.content) + if not retry: + LOGGER.warning(f"{cls.__name__} responded wit {r.status_code} at POST:{url}. ({trie}-{cls.TRIES})") + LOGGER.debug(r.content) if trie >= cls.TRIES: LOGGER.warning("to many tries. Aborting.")