fix: add debug logging to silent catch blocks in core GEP modules#498
fix: add debug logging to silent catch blocks in core GEP modules#498gugli4ifenix-design wants to merge 1 commit intoEvoMap:mainfrom
Conversation
…e.js Several empty catch blocks silently swallow errors that could indicate real issues: - assetStore.js: malformed JSONL lines in gene/capsule stores are silently discarded, making it impossible to diagnose corrupted asset files. - a2a.js: computeAssetId failures are silently ignored, meaning assets can end up without identity — breaking deduplication and lineage tracking. All logging is gated behind DEBUG env var to preserve current behavior in production while enabling observability during development. Found via automated security/quality scan.
|
Thank you @gugli4ifenix-design for the careful analysis. We evaluated this PR but are not adopting it for the following reasons.
What we did adopt: PR #497 for Why we cannot merge the code PR directly even when we adopt the idea: this repository is built from an internal maintainer branch and published here as a distribution artifact. External code PRs are not merged into the upstream; we port the intent manually when we agree with it. You will be credited in release notes for the pieces we do adopt. Thanks again for the scan work — empty catch blocks are a real correctness risk and the specific files you flagged were the right ones to look at first. Closing as evaluated-declined. |
Summary
Add debug-gated error logging to silent
catchblocks insrc/gep/a2a.jsandsrc/gep/assetStore.js.Problem
Several empty catch blocks silently swallow errors that could indicate real issues:
computeAssetId()failures are silently ignored, meaning assets can end up without anasset_id. This breaks deduplication, lineage tracking, and any downstream logic that relies on stable identity.Solution
All logging is gated behind
process.env.DEBUGto preserve current behavior in production while enabling observability during development:Zero behavior change for existing users. Only visible when
DEBUG=1is set.How found
Automated code quality scan flagged 132 empty catch blocks across the codebase. This PR addresses the ones in core GEP logic where silent failures could mask data integrity issues. Cleanup ops (
fs.rmSync,fs.unlinkSync) and format-probing patterns were intentionally left unchanged.