Return exit code 1 on CTRL+C cancellation#3264
Conversation
User-initiated cancellation should signal failure to the shell just like any other abnormal exit, so CI and scripts don't silently swallow it. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a single line to the 🚥 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✨ Simplify code
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 |
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Why
When a user presses CTRL+C, the process was exiting with code 0, making it indistinguishable from a successful run. This caused CI pipelines and shell scripts to silently swallow user-initiated cancellations as if the build had succeeded.
What
CatchExceptionMiddlewarenow setscontext.ExitCode = 1before returning on the CTRL+C path, so cancellation always signals failure to the caller — without emitting a spurious global error log entry.