diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-01-20 08:36:21 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-01-20 08:36:21 -0800 |
commit | 561a32428b839b8cff01da944e09a6c9e1c7fb52 (patch) | |
tree | 18ea63d5afa1f4feeecfc93a292cea9d7b6a1f43 /wee_slack.py | |
parent | 39e96ed0ad81a062e333232c9c30d9abfe0ab66a (diff) | |
download | wee-slack-561a32428b839b8cff01da944e09a6c9e1c7fb52.tar.gz |
move try up a bit
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wee_slack.py b/wee_slack.py index 88c6fe0..e948281 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1109,10 +1109,7 @@ def unfurl_refs(text): def get_user(message_json, server): if 'user' in message_json: - try: - name = server.users.find(message_json['user']).name - except: - dbg("cannot find name {}".format(message_json['user'])) + name = server.users.find(message_json['user']).name elif 'username' in message_json: name = u"-{}-".format(message_json["username"]) elif 'service_name' in message_json: @@ -1285,7 +1282,10 @@ def url_processor_cb(data, command, return_code, out, err): for message in my_json["messages"]: message["myserver"] = servers.find(token).domain message["channel"] = servers.find(token).channels.find(channel).identifier - process_message(message) + try: + process_message(message) + except: + dbg("cannot process message {}".format(message)) if "channel" in my_json: if "members" in my_json["channel"]: channels.find(my_json["channel"]["id"]).members = set(my_json["channel"]["members"]) |