fix: unify error handling in logs and functions/invoke#23
fix: unify error handling in logs and functions/invoke#23jwfing merged 4 commits intoInsForge:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThree CLI command modules switch from immediate process termination to throwing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can validate your CodeRabbit configuration file in your editor.If your editor has YAML language server, you can enable auto-completion and validation by adding |
|
@Abh1shxkk Could you change other files too?, for example:
|
|
hi @jwfing done also fixed |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/functions/deploy.ts`:
- Around line 82-86: The code double-reports failures because
reportCliUsage('cli.functions.deploy', !deployFailed) is called just before
throwing CLIError and then again in the catch; remove the pre-throw call and
ensure reportCliUsage is invoked once: call reportCliUsage(true) on the
successful path (when deployFailed is false) and let the catch block call
reportCliUsage(false) on errors. Update the logic around the deploy flow
(references: reportCliUsage, deployFailed, CLIError, handleError, json) so
failures are only reported in the catch and successes are reported once after
the try completes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f57285ee-4977-4553-9667-ebf29ea00a70
📒 Files selected for processing (1)
src/commands/functions/deploy.ts
|
Hey @jwfing, addressed both review points:
All error handling is now unified across the project. Ready for re-review! |
Closes #18
Replace
console.error+process.exit(1)withCLIErrorthrows inlogs.tsandfunctions/invoke.tsso all errors flow through the centralhandleErrorfunction.Summary by CodeRabbit