Log files with invalid JSON

This commit is contained in:
Peter J. Holzer 2024-05-24 22:32:25 +02:00
parent d3ac6703c6
commit 9a84e191be
1 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,9 @@ class LTS:
fcntl.flock(fh, fcntl.LOCK_EX)
json.dump({"description": self.description, "data": self.data}, fh)
self.rebuild_index()
except json.decoder.JSONDecodeError as e:
log.exception(f"Cannot decode JSON in {self.filename}: {e}")
raise
def pop(self, i):
# Pop the element at index i and adjust the min/max values of the