diff options
author | Tollef Fog Heen <tfheen@err.no> | 2016-09-24 22:59:14 +0200 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2016-09-24 22:59:14 +0200 |
commit | 810272a58ed1bcde631809c01d86166e5cf2c9c6 (patch) | |
tree | 1c40d4e6a82c178bdd76622864193fd2c2eafdcc | |
parent | 531e6c63f4173ddc6996c9758d681a1149bf5747 (diff) | |
download | wee-slack-810272a58ed1bcde631809c01d86166e5cf2c9c6.tar.gz |
Continue even on cache loading errors.
If we get a ValueError when loading the json, continue, instead of
making the user unhappy.
Closes: #248
-rw-r--r-- | wee_slack.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 010715e..82e34b7 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2143,6 +2143,9 @@ def cache_load(): j = json.loads(line) message_cache[j["channel"]].append(line) dbg("Completed loading messages from cache.", main_buffer=True) + except ValueError: + w.prnt("", "Failed to load cache file, probably illegal JSON.. Ignoring") + pass except IOError: w.prnt("", "cache file not found") pass |