diff options
author | Wolfgang Müller | 2024-09-19 20:31:38 +0200 |
---|---|---|
committer | Wolfgang Müller | 2024-09-19 20:31:38 +0200 |
commit | 4410255c63b75e8a119d237432cabe972cb33359 (patch) | |
tree | 624b2218989c09333f5f83ae8ebb065263b55e6d | |
parent | 06a4bcc74f8a9deaa7b28f5cca1982caf83b6db3 (diff) | |
download | later-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-x | later | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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(): |