Repository navigation
fix(dif): log errors in tryProguard and tryObject catch blocks - #1513
Conversation
Three catch blocks in find.ts silently discarded errors when reading, hashing, or parsing debug-information files. Users running `debug-files find` had no way to tell why certain files were skipped. Added logger.debug() to each catch block so failures appear with --verbose. Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| "src/lib/detect-agent.ts": 2, | ||
| "src/lib/dev-script.ts": 2, | ||
| "src/lib/dif/find.ts": 3, | ||
| "src/lib/dif/find.ts": 0, |
There was a problem hiding this comment.
Jared, I thought we got rid of this baseline thing in favor of a lint rule?
There was a problem hiding this comment.
the baseline is still the enforcement mechanism — it's the ratchet from #1471 (check:errors in CI, script/check-error-patterns.ts). there's no biome/eslint rule that replaced it; biome's noEmptyBlockStatements only catches syntactically-empty catch {}, not comment-only or return-only silent catches, which is why the custom checker + baseline exists. dropping this file's count from 3→0 is the intended way to record the fix, so the ratchet can only shrink. happy to open a follow-up if you want to migrate to a lint rule, but that's out of scope here.
There was a problem hiding this comment.
you're right — #1487 landed the grit rule (lint-rules/no-silent-catch.grit) and wired it via biome.jsonc override on src/**. the old check-error-patterns.ts + baseline is still wired in CI (check:errors) for now, but the grit rule is the active enforcement going forward. the baseline drop in this PR is just the last ratchet record before the migration; once the grit rule is the sole source of truth the baseline file can be removed. thanks for the correction.
|
Jared, take over the PR, get it ready to be merged and then merge when ready. |
|
taken over. the CI failure was a formatter error — the the enabled squash auto-merge; it'll land as soon as the required CI Status check goes green. (the extra |
Bug
tryProguard()andtryObject()insrc/lib/dif/find.tscontained three silent catch blocks that discarded errors when reading, hashing, or parsing debug-information files duringdebug-files find.Root cause
Three catch blocks used bare
catch { return; }without any logging, violating the project's silent-catch prohibition. Users runningsentry debug-files findhad no way to diagnose why certain files were silently skipped.Reproduction
Any file I/O error (permissions, corrupted files, disk issues) during debug file scanning would be silently swallowed, providing no diagnostic output even with
--verbose.Fix
logger.debug()to all three catch blocks intryProguard(ProGuard UUID computation) andtryObject(format peek + debug file parse)