From 86f339f4f6102df78eb7e0aa8532c941a5f1e6d3 Mon Sep 17 00:00:00 2001 From: DevilXD <4180725+DevilXD@users.noreply.github.com> Date: Mon, 2 Sep 2024 09:59:37 +0200 Subject: [PATCH] Treat ClientPayloadError as a failed request --- twitch.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/twitch.py b/twitch.py index a4b9826..83df34c 100644 --- a/twitch.py +++ b/twitch.py @@ -1293,12 +1293,15 @@ class Twitch: yield response return self.print(_("error", "site_down").format(seconds=round(delay))) - except aiohttp.ClientConnectorCertificateError: # type: ignore[unused-ignore] + except aiohttp.ClientConnectorCertificateError: # for a case where SSL verification fails raise - except (aiohttp.ClientConnectionError, asyncio.TimeoutError): - # just so that quick retries that often happen, aren't shown + except ( + aiohttp.ClientConnectionError, asyncio.TimeoutError, aiohttp.ClientPayloadError + ): + # connection problems, retry if backoff.steps > 1: + # just so that quick retries that sometimes happen, aren't shown self.print(_("error", "no_connection").format(seconds=round(delay))) finally: if response is not None: