Skip to content

Commit 0536899

Browse files
authored
fix: Raise WebSocketClosure on protocol level errors (#2435)
1 parent c12670a commit 0536899

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

discord/gateway.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,11 @@ async def poll_event(self):
603603
await self.received_message(msg.data)
604604
elif msg.type is aiohttp.WSMsgType.BINARY:
605605
await self.received_message(msg.data)
606-
elif msg.type is aiohttp.WSMsgType.ERROR:
607-
_log.debug("Received %s", msg)
608-
raise msg.data
609606
elif msg.type in (
610607
aiohttp.WSMsgType.CLOSED,
611608
aiohttp.WSMsgType.CLOSING,
612609
aiohttp.WSMsgType.CLOSE,
610+
aiohttp.WSMsgType.ERROR,
613611
):
614612
_log.debug("Received %s", msg)
615613
raise WebSocketClosure

0 commit comments

Comments
 (0)