Skip to content

Commit 966d7c1

Browse files
fix: narrow exception catch in filepath encode to (FileNotFoundError, OSError)
Addresses review comment — the bare `except Exception` was too broad. backend.size() can only fail with filesystem-related errors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8b837b9 commit 966d7c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/datajoint/builtin_codecs/filepath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def encode(self, value: Any, *, key: dict | None = None, store_name: str | None
153153
if not is_dir:
154154
try:
155155
size = backend.size(path)
156-
except Exception:
156+
except (FileNotFoundError, OSError):
157157
pass
158158

159159
return {

0 commit comments

Comments
 (0)