Skip to content

Commit 32b548c

Browse files
committed
fix: catch OSError/UnicodeError in cache read path
1 parent b38a161 commit 32b548c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/specify_cli/integrations/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def _fetch_single_catalog(
247247
age = (datetime.now(timezone.utc) - cached_at).total_seconds()
248248
if age < self.CACHE_DURATION:
249249
return json.loads(cache_file.read_text(encoding="utf-8"))
250-
except (json.JSONDecodeError, ValueError, KeyError, TypeError, AttributeError):
250+
except (json.JSONDecodeError, ValueError, KeyError, TypeError, AttributeError, OSError, UnicodeError):
251251
# Cache is invalid or stale metadata; delete and refetch from source.
252252
try:
253253
cache_file.unlink(missing_ok=True)

0 commit comments

Comments
 (0)