aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorWolfgang Müller2024-09-19 20:31:38 +0200
committerWolfgang Müller2024-09-19 20:31:38 +0200
commit4410255c63b75e8a119d237432cabe972cb33359 (patch)
tree624b2218989c09333f5f83ae8ebb065263b55e6d
parent06a4bcc74f8a9deaa7b28f5cca1982caf83b6db3 (diff)
downloadlater-4410255c63b75e8a119d237432cabe972cb33359.tar.gz
Handle OSErrors when writing out the title cache
We handle these when reading the file, so we might as well do it here.
-rwxr-xr-xlater7
1 files changed, 5 insertions, 2 deletions
diff --git a/later b/later
index 59220af..3d43578 100755
--- a/later
+++ b/later
@@ -118,8 +118,11 @@ class TitleMap:
os.makedirs(later_cache_dir, exist_ok=True)
- with open(self.path, "w") as handle:
- json.dump(self.map, handle)
+ try:
+ with open(self.path, "w") as handle:
+ json.dump(self.map, handle)
+ except OSError as err:
+ sys.exit(f"later: {err}")
def entries():