Browse Source

Raise WebSocketClosure on protocol level errors

Ref: #9561
pull/9618/head
Rapptz 1 year ago
parent
commit
163a86c4a0
  1. 4
      discord/gateway.py

4
discord/gateway.py

@ -624,8 +624,8 @@ class DiscordWebSocket:
elif msg.type is aiohttp.WSMsgType.BINARY:
await self.received_message(msg.data)
elif msg.type is aiohttp.WSMsgType.ERROR:
_log.debug('Received %s', msg)
raise msg.data
_log.debug('Received error %s', msg)
raise WebSocketClosure
elif msg.type in (aiohttp.WSMsgType.CLOSED, aiohttp.WSMsgType.CLOSING, aiohttp.WSMsgType.CLOSE):
_log.debug('Received %s', msg)
raise WebSocketClosure

Loading…
Cancel
Save