aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-07-14 11:06:00 -0400
committerRapptz <[email protected]>2017-07-14 11:06:00 -0400
commit2e57fa6dfd44ae9a3d7343386ea557d44eff3678 (patch)
treea2cf10308c667b292c0b780e91f1dbe10e8333a8
parentExpose reverse parameter in TextChannel.purge (diff)
downloaddiscord.py-2e57fa6dfd44ae9a3d7343386ea557d44eff3678.tar.xz
discord.py-2e57fa6dfd44ae9a3d7343386ea557d44eff3678.zip
Don't re-raise in Client.connect if it's a clean close code.
-rw-r--r--discord/client.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index 2c5ed69c..b338cc13 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -396,6 +396,9 @@ class Client:
if not reconnect:
yield from self.close()
+ if isinstance(e, ConnectionClosed) and e.code == 1000:
+ # clean close, don't re-raise this
+ return
raise
if self.is_closed():