From 810272a58ed1bcde631809c01d86166e5cf2c9c6 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sat, 24 Sep 2016 22:59:14 +0200 Subject: Continue even on cache loading errors. If we get a ValueError when loading the json, continue, instead of making the user unhappy. Closes: #248 --- wee_slack.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit