aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-04-22 17:09:01 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-05-30 21:13:20 +0200
commitbf912d25ce36f1a368273e7d602e98d4daffc993 (patch)
tree2199d19c00ac3af91645acde39eb253d5232f54f /wee_slack.py
parentecf450bbfa753c76d4f682f99b87dc0ce3be51bb (diff)
downloadwee-slack-bf912d25ce36f1a368273e7d602e98d4daffc993.tar.gz
In connect, don't catch exceptions from set_connected
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 3f39744..e617c3c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1427,16 +1427,16 @@ class SlackTeam(object):
self.hook = w.hook_fd(ws.sock.fileno(), 1, 0, 0, "receive_ws_callback", self.get_team_hash())
ws.sock.setblocking(0)
- self.ws = ws
- self.set_reconnect_url(None)
- self.set_connected(reconnect)
- self.connecting_ws = False
except:
w.prnt(self.channel_buffer,
'Failed connecting to slack team {}, retrying.'.format(self.domain))
dbg('connect failed with exception:\n{}'.format(format_exc_tb()), level=5)
- self.connecting_ws = False
return False
+ finally:
+ self.connecting_ws = False
+ self.ws = ws
+ self.set_reconnect_url(None)
+ self.set_connected(reconnect)
elif not self.connecting_rtm:
# The fast reconnect failed, so start over-ish
for chan in self.channels: