From 09b55c8e7c5935f31638e10637f954beeeb02da8 Mon Sep 17 00:00:00 2001 From: dolfies Date: Tue, 3 Dec 2024 23:00:18 -0500 Subject: [PATCH] Ignore CURLE_GOT_NOTHING --- discord/gateway.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/discord/gateway.py b/discord/gateway.py index 2d21e4bca5e0..314d15098ccd 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -665,11 +665,14 @@ async def poll_event(self) -> None: if (flags & CurlWsFlag.TEXT) or (flags & CurlWsFlag.BINARY): await self.received_message(msg) elif flags & CurlWsFlag.CLOSE: - _log.debug('Received %s.', msg) err = WebSocketClosure(msg) _log.info(f'Got close {err.code} reason {err.reason}') raise WebSocketClosure(msg) except (asyncio.TimeoutError, CurlError, WebSocketClosure) as e: + if isinstance(e, CurlError) and e.code == 52: + _log.debug('Gateway received CURLE_GOT_NOTHING, ignoring...') + return + _log.info(f'Got poll exception {e}') # Ensure the keep alive handler is closed if self._keep_alive: