fix: reorder systemInfo logging after error stack#8268
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe uncaught-exception handler in the CLI entry point reorders its logging sequence: the error stack ( Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
📊 Benchmark resultsComparing with dfcc0a2
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/commands/main.ts`:
- Around line 99-101: The uncaughtException handler calls getSystemInfo() (which
uses envinfo.run and may reject) without safeguards, so wrap the system info
retrieval in a try-catch-finally inside the uncaughtException handler: call
getSystemInfo() inside try and log its output if successful, catch any error
from envinfo.run and log or ignore it, then ensure reportError(err, { severity:
'error' }) is invoked and process.exit(1) is always called in finally; reference
the getSystemInfo function, envinfo.run internals, the existing reportError
call, and the process.exit(1) to locate where to add the try-catch-finally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a4d1cfc3-ff7c-4fad-a23d-4ca5f94bbb3c
📒 Files selected for processing (1)
src/commands/main.ts
|
New PR: #8269 |
🎉 Thanks for submitting a pull request! 🎉 #### Summary Next iteration of: #8268. This PR should fix the original issue of the CLI ending in a loop. It should exit as soon as the error is triggered.
🎉 Thanks for submitting a pull request! 🎉
Summary
For cases like these: https://answers.netlify.com/t/157384/
The CLI was quitting without any error message - most likely because the systemInfo() async call didn't finish (in time). With this change, we'd at least always see the error message which could lead to some debugging other than everyone being lost on what the actual error is.