Skip to content

chore: replace process.exit calls with actual error thrown#1089

Merged
aduh95 merged 1 commit into
nodejs:mainfrom
aduh95:throw-instead-of-exit
Jun 1, 2026
Merged

chore: replace process.exit calls with actual error thrown#1089
aduh95 merged 1 commit into
nodejs:mainfrom
aduh95:throw-instead-of-exit

Conversation

@aduh95
Copy link
Copy Markdown
Contributor

@aduh95 aduh95 commented Jun 1, 2026

I can't think of a reason why we'd want to call process.exit instead of throwing an error, on the contrary throwing an error makes debugging and testing much more straightforward

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.93%. Comparing base (e084f7a) to head (cd736a1).

Files with missing lines Patch % Lines
lib/security_blog.js 33.33% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1089      +/-   ##
==========================================
+ Coverage   64.89%   64.93%   +0.04%     
==========================================
  Files          45       45              
  Lines        6947     6938       -9     
==========================================
- Hits         4508     4505       -3     
+ Misses       2439     2433       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@targos
Copy link
Copy Markdown
Member

targos commented Jun 1, 2026

I didn't write this code but from my experience, I tend to avoid throwing errors for cases that are not bugs in the code. As a CLI user, a stack trace is not the best UX for operational errors.

@aduh95
Copy link
Copy Markdown
Contributor Author

aduh95 commented Jun 1, 2026

As a CLI user, a stack trace is not the best UX for operational errors.

Those are disabled by default since #990.

@aduh95 aduh95 merged commit 4ea22b8 into nodejs:main Jun 1, 2026
12 of 13 checks passed
@aduh95 aduh95 deleted the throw-instead-of-exit branch June 1, 2026 15:59
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.

2 participants