refactor: replace empty catch blocks with descriptive comments#1408
Open
apoorvdarshan wants to merge 2 commits intogoogle:mainfrom
Open
refactor: replace empty catch blocks with descriptive comments#1408apoorvdarshan wants to merge 2 commits intogoogle:mainfrom
apoorvdarshan wants to merge 2 commits intogoogle:mainfrom
Conversation
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
ce5d957 to
f45a92e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
catchblocks incore.tsandcli.ts, documenting why errors are intentionally ignored (bash fallback on non-Unix systems, process already exited during kill, file existence check)process.exit(1)inreadScriptFromHttpwithprocess.exitCode = 1+throw new Fail(...)for consistent error handling with the rest of the codebaseRef #1394
Test plan