Skip to content

Commit

Permalink
Treat ClientPayloadError as a failed request
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilXD committed Sep 2, 2024
1 parent a42a72b commit 86f339f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1293,12 +1293,15 @@ async def request(
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:
Expand Down

0 comments on commit 86f339f

Please sign in to comment.