From 5dd8e372e4a5aa3749d85f8fd2f7eb4d779512cb Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 6 Aug 2020 09:25:01 -0400 Subject: [PATCH] Terminate connection if a close code couldn't be handled --- discord/gateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/gateway.py b/discord/gateway.py index 6fde1a970..a4a39186c 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -522,7 +522,7 @@ class DiscordWebSocket: if self._can_handle_close(): log.info('Websocket closed with %s, attempting a reconnect.', code) raise ReconnectWebSocket(self.shard_id) from None - elif self.socket.close_code is not None: + else: log.info('Websocket closed with %s, cannot reconnect.', code) raise ConnectionClosed(self.socket, shard_id=self.shard_id, code=code) from None