aboutsummaryrefslogtreecommitdiff
path: root/discord/errors.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-04-07 21:53:55 -0400
committerRapptz <[email protected]>2020-07-25 09:59:38 -0400
commitb8154e365ff584438a8d42354e56881e550bb72e (patch)
tree799c9bb73c25731a87cb12c04a35b420260f8970 /discord/errors.py
parentFix AttributeError on reconnection (diff)
downloaddiscord.py-b8154e365ff584438a8d42354e56881e550bb72e.tar.xz
discord.py-b8154e365ff584438a8d42354e56881e550bb72e.zip
Rewrite gateway to use aiohttp instead of websockets
Diffstat (limited to 'discord/errors.py')
-rw-r--r--discord/errors.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/discord/errors.py b/discord/errors.py
index 7ab73e9d..f8da42d1 100644
--- a/discord/errors.py
+++ b/discord/errors.py
@@ -159,10 +159,11 @@ class ConnectionClosed(ClientException):
shard_id: Optional[:class:`int`]
The shard ID that got closed if applicable.
"""
- def __init__(self, original, *, shard_id):
+ def __init__(self, socket, *, shard_id):
# This exception is just the same exception except
# reconfigured to subclass ClientException for users
- self.code = original.code
- self.reason = original.reason
+ self.code = socket.close_code
+ # aiohttp doesn't seem to consistently provide close reason
+ self.reason = ''
self.shard_id = shard_id
- super().__init__(str(original))
+ super().__init__('Shard ID %s WebSocket closed with %s' % (self.shard_id, self.code))