Pre-read the response to avoid getting errors outside of the context manager
This commit is contained in:
1 parent
bd652417dc
commit
b216d41492
1 file changed
+2
@@ -1027,6 +1027,8 @@ class Twitch:
|
||||
logger.debug(f"Response: {response.status}: {response}")
|
||||
if response.status >= 500:
|
||||
self.print(_("error", "site_down").format(seconds=round(delay)))
|
||||
# pre-read the response to avoid getting errors outside of the context manager
|
||||
await response.read()
|
||||
yield response
|
||||
return
|
||||
except (aiohttp.ClientConnectionError, asyncio.TimeoutError):
|
||||
|
||||
Reference in new issue
Block a user