aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2016-09-25 20:31:30 +0200
committerGitHub <noreply@github.com>2016-09-25 20:31:30 +0200
commit4958bfeddd9b8a02ae0e56e4d54b06dc05641a6f (patch)
tree34e9436cf4acc71aad662851758204f56eccebee /wee_slack.py
parent0f6d99a6757458b8c59ab78fd0e442a123f6815f (diff)
parent948173a30295716baff3639e701c766900d4c758 (diff)
downloadwee-slack-4958bfeddd9b8a02ae0e56e4d54b06dc05641a6f.tar.gz
Merge pull request #255 from rawdigits/tfheen/print-wrong-token
Print out first ten characters of erroring tokens
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 1219836..be3d2bd 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -253,7 +253,15 @@ class SlackServer(object):
self.message_buffer.pop(message_id)
return True
else:
- w.prnt("", "\n!! slack.com login error: " + login_data["error"] + "\n Please check your API token with\n \"/set plugins.var.python.slack_extension.slack_api_token (token)\"\n\n ")
+ token_start = self.token[:10]
+ error = """
+!! slack.com login error: {}
+ The problematic token starts with {}
+ Please check your API token with
+ "/set plugins.var.python.slack_extension.slack_api_token (token)"
+
+""".format(login_data["error"], token_start)
+ w.prnt("", error)
self.connected = False
def print_connection_info(self, login_data):