aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2016-09-25 17:24:46 +0200
committerTollef Fog Heen <tfheen@err.no>2016-09-25 17:24:46 +0200
commit948173a30295716baff3639e701c766900d4c758 (patch)
tree34e9436cf4acc71aad662851758204f56eccebee /wee_slack.py
parent0f6d99a6757458b8c59ab78fd0e442a123f6815f (diff)
downloadwee-slack-948173a30295716baff3639e701c766900d4c758.tar.gz
Print out first ten characters of erroring tokens
If you have multiple tokens, it can be hard to figure out which one is causing an error, so print out the first ten characters to help identify the problematic one. Fixes: #163
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):