Skip to content

fix: narrow scan_directory exception catch#15

Merged
stef41 merged 1 commit intomainfrom
fix/scanner-exception-narrowing
Apr 11, 2026
Merged

fix: narrow scan_directory exception catch#15
stef41 merged 1 commit intomainfrom
fix/scanner-exception-narrowing

Conversation

@stef41
Copy link
Copy Markdown
Owner

@stef41 stef41 commented Apr 11, 2026

Bare except Exception: continue in scan_directory() silently swallows unexpected errors. Narrows to OSError and UnicodeDecodeError — the two expected failure modes when walking a directory tree.

All 193 tests pass.

Bare 'except Exception: continue' silently swallows unexpected errors
(TypeError, MemoryError, etc.) during directory scanning. Narrow to
OSError (permission/IO) and UnicodeDecodeError (encoding mismatch),
letting real bugs propagate.

Co-authored-by: 87280280+stef41@users.noreply.github.com
@stef41 stef41 merged commit a1e5dc2 into main Apr 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant