Skip to content

Commit

Permalink
Ignore CURLE_GOT_NOTHING
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Dec 4, 2024
1 parent 436a93c commit 09b55c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion discord/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 09b55c8

Please sign in to comment.