From 564d48486a7087727ffcc5ec1b77430b96e66469 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 16 Sep 2017 22:00:07 +0200 Subject: Improve error message when weemoji.json is not found By printing the exception instead of sys.exc_info, we get more useful error messages, including the path to the file it is trying to load if it can't find it. Fixes #431 --- wee_slack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wee_slack.py b/wee_slack.py index f239cdd..0caab43 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3234,8 +3234,8 @@ def load_emoji(): ef = open('{}/weemoji.json'.format(DIR), 'r') EMOJI = json.loads(ef.read()) ef.close() - except: - dbg("Unexpected error: {}".format(sys.exc_info()), 5) + except Exception as e: + dbg("Couldn't load emoji list: {}".format(e), 5) return w.WEECHAT_RC_OK -- cgit