Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions slackclient/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def rtm_connect(self, reconnect=False, timeout=None):
reply = self.api_requester.do(self.token, "rtm.start", timeout=timeout)

if reply.status_code != 200:
raise SlackConnectionError
raise SlackConnectionError(reply=reply)
else:
login_data = reply.json()
if login_data["ok"]:
Expand All @@ -79,7 +79,7 @@ def rtm_connect(self, reconnect=False, timeout=None):
if not reconnect:
self.parse_slack_login_data(login_data)
else:
raise SlackLoginError
raise SlackLoginError(reply=reply)

def parse_slack_login_data(self, login_data):
self.login_data = login_data
Expand Down Expand Up @@ -107,7 +107,7 @@ def connect_slack_websocket(self, ws_url):
http_proxy_auth=proxy_auth)
self.websocket.sock.setblocking(0)
except Exception as e:
raise SlackConnectionError(str(e))
raise SlackConnectionError(message=str(e))

def parse_channel_data(self, channel_data):
for channel in channel_data:
Expand Down Expand Up @@ -226,8 +226,12 @@ class SlackCongigurationError(Exception):


class SlackConnectionError(Exception):
pass
def __init__(self, message='', reply=None):
super(SlackConnectionError, self).__init__(message)
self.reply = reply


class SlackLoginError(Exception):
pass
def __init__(self, message='', reply=None):
super(SlackLoginError, self).__init__(message)
self.reply = reply