Print error message when initial connection fails
I chose to print this instead of using dbg since it's a rather critical
error message.
Fixes
@@ -2031,10 +2031,9 @@ def handle_rtmstart(login_data, eventrouter):
"""
This handles the main entry call to slack, rtm.start
"""
- if login_data["ok"]:
-
metadata = pickle.loads(login_data["wee_slack_request_metadata"])
+ if login_data["ok"]:
# Let's reuse a team if we have it already.
th = SlackTeam.generate_team_hash(login_data['self']['name'], login_data['team']['domain'])
if not eventrouter.teams.get(th):
@@ -2103,6 +2102,10 @@ def handle_rtmstart(login_data, eventrouter):
dbg("connected to {}".format(t.domain))
+ else:
+ w.prnt("", "ERROR: Failed connecting to Slack with token {}: {}"
+ .format(metadata.token, login_data["error"]))
+
# self.identifier = self.domain
def handle_channelsinfo(channel_json, eventrouter, **kwargs):
