aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2016-09-24 22:59:14 +0200
committerTollef Fog Heen <tfheen@err.no>2016-09-24 22:59:14 +0200
commit810272a58ed1bcde631809c01d86166e5cf2c9c6 (patch)
tree1c40d4e6a82c178bdd76622864193fd2c2eafdcc /wee_slack.py
parent531e6c63f4173ddc6996c9758d681a1149bf5747 (diff)
downloadwee-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
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py3
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