diff options
Diffstat (limited to 'warmachine/connections/slack.py')
| -rw-r--r-- | warmachine/connections/slack.py | 7 |
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 | |||
| 4 | from pprint import pformat | 4 | from pprint import pformat |
| 5 | from urllib.parse import urlencode | 5 | from urllib.parse import urlencode |
| 6 | import urllib.request | 6 | import urllib.request |
| 7 | import sys | ||
| 7 | 8 | ||
| 8 | import websockets | 9 | import 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 |