Skip to content

Commit

Permalink
Raise WebSocketClosure on protocol level errors
Browse files Browse the repository at this point in the history
Ref: #9561
  • Loading branch information
Rapptz committed Oct 19, 2023
1 parent 5eb2f30 commit 163a86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/gateway.py
Expand Up @@ -624,8 +624,8 @@ async def poll_event(self) -> None:
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
Expand Down

0 comments on commit 163a86c

Please sign in to comment.