Prevent ruff running on a couple of lines where catching and not logging an exception is a deliberate choice.

This commit is contained in:
Ian Renton
2026-09-20 09:55:22 +01:00
parent 1b41520f7c
commit 2df7ecf4b5
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ class LiveDataCache:
def _load_snapshot(self): def _load_snapshot(self):
try: try:
data = self._disk_cache.get("snapshot") data = self._disk_cache.get("snapshot")
except Exception: except Exception: # noqa: BLE001 (If any exceptions we treat the data as junk and start from scratch, it's probably due to a version upgrade having incompatible data structures, fine to not log the exception in this case)
logger.warning(f"Failed to load snapshot from {self._snapshot_dir}, clearing it.") logger.warning(f"Failed to load snapshot from {self._snapshot_dir}, clearing it.")
self._disk_cache.clear() self._disk_cache.clear()
return return
+1 -1
View File
@@ -23,7 +23,7 @@ class SingleObjectDataCache:
self._cache.add("object", object_if_empty) self._cache.add("object", object_if_empty)
try: try:
self._obj = self._cache.get("object") self._obj = self._cache.get("object")
except Exception: except Exception: # noqa: BLE001 (If any exceptions we treat the data as junk and start from scratch, it's probably due to a version upgrade having incompatible data structures, fine to not log the exception in this case)
logger.warning(f"Failed to load cache from {cache_dir}, clearing it.") logger.warning(f"Failed to load cache from {cache_dir}, clearing it.")
self._cache.clear() self._cache.clear()
self._cache.add("object", object_if_empty) self._cache.add("object", object_if_empty)