Skip to content

refactor: replace empty catch blocks with descriptive comments#1408

Open
apoorvdarshan wants to merge 2 commits intogoogle:mainfrom
apoorvdarshan:fix/empty-catch-blocks
Open

refactor: replace empty catch blocks with descriptive comments#1408
apoorvdarshan wants to merge 2 commits intogoogle:mainfrom
apoorvdarshan:fix/empty-catch-blocks

Conversation

@apoorvdarshan
Copy link

Summary

  • Adds explanatory comments to all empty catch blocks in core.ts and cli.ts, documenting why errors are intentionally ignored (bash fallback on non-Unix systems, process already exited during kill, file existence check)
  • Replaces abrupt process.exit(1) in readScriptFromHttp with process.exitCode = 1 + throw new Fail(...) for consistent error handling with the rest of the codebase

Ref #1394

Test plan

  • All 132 core tests pass
  • All 40 CLI tests pass
  • Size limits, license, and circular dependency checks pass

Empty catch blocks silently swallow errors, making debugging harder and
violating code quality best practices. This adds explanatory comments
to all empty catch blocks in core.ts and cli.ts, and replaces the
abrupt process.exit(1) in readScriptFromHttp with a proper Fail error
for consistent error handling.

Ref google#1394
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