aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wee_slack.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 75fe695..c1e683b 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -453,9 +453,11 @@ class EventRouter(object):
self.reply_buffer.pop(request_metadata.response_id, None)
self.delete_context(data)
if request_metadata.request == 'rtm.start':
- w.prnt('', ('Failed connecting to slack team with token starting with {}, ' +
- 'retrying. If this persists, try increasing slack_timeout.')
- .format(request_metadata.token[:15]))
+ retry_text = ('retrying' if request_metadata.should_try() else
+ 'will not retry after too many failed attempts')
+ w.prnt('', ('Failed connecting to slack team with token starting with {}, {}. ' +
+ 'If this persists, try increasing slack_timeout.')
+ .format(request_metadata.token[:15], retry_text))
dbg('rtm.start failed with return_code {}. stack:\n{}'
.format(return_code, ''.join(traceback.format_stack())), level=5)
self.receive(request_metadata)