aboutsummaryrefslogtreecommitdiffstats
path: root/warmachine/connections/slack.py
diff options
context:
space:
mode:
Diffstat (limited to 'warmachine/connections/slack.py')
-rw-r--r--warmachine/connections/slack.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/warmachine/connections/slack.py b/warmachine/connections/slack.py
index 26113b9..116a540 100644
--- a/warmachine/connections/slack.py
+++ b/warmachine/connections/slack.py
@@ -4,6 +4,7 @@ import logging
4from pprint import pformat 4from pprint import pformat
5from urllib.parse import urlencode 5from urllib.parse import urlencode
6import urllib.request 6import urllib.request
7import sys
7 8
8import websockets 9import websockets
9 10
@@ -46,7 +47,11 @@ class SlackWS(Connection):
46 return md5(self.token.encode()).hexdigest() 47 return md5(self.token.encode()).hexdigest()
47 48
48 async def connect(self): 49 async def connect(self):
49 self.host = self.authenticate() 50 try:
51 self.host = self.authenticate()
52 except Exception:
53 self.log.exception('Error authenticating to slack')
54 return
50 self.log.info('Connecting to {}'.format(self.host)) 55 self.log.info('Connecting to {}'.format(self.host))
51 self.ws = await websockets.connect(self.host) 56 self.ws = await websockets.connect(self.host)
52 self.STATUS = CONNECTED 57 self.STATUS = CONNECTED