Browse Source

Terminate connection if a close code couldn't be handled

pull/5212/head
Rapptz 5 years ago
parent
commit
5dd8e372e4
  1. 2
      discord/gateway.py

2
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

Loading…
Cancel
Save