Repository navigation
fix(cli)!: exit 1 for runtime failures reported through this.error [RED-1274] [ship] - #1583
Merged
Merged
Conversation
…ED-1274] oclif's this.error() exits 2 unless given an exit code, the same code as a usage error. Five runtime failures used it bare: an unknown entitlement key in `account plan`, a cancelled account prompt in `login`, an unreadable action file in `skills`, and a failed skill-file read or write in `skills install`. They now exit 1, so exit 2 means only invalid input. switch's cancel already exited 1 through its rewrapping catch; it now passes the exit code itself, which changes nothing. BREAKING CHANGE: the failures above exit 1 instead of 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sorccu
force-pushed
the
simo/red-1274-runtime-error-exit-code
branch
from
October 26, 2026 18:31
ba337b5 to
09d2dad
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.
Linear: RED-1274
oclif's
this.error()exits 2 unless given an exit code, the same code as a usage error. Five runtime failures used it without one, so a script or agent could not tell "called wrongly" from "failed". They now pass{ exit: 1 }, and exit 2 is left for invalid input.The 27 other
this.error()calls reject invalid flag or argument values (an unknown--target,--limitout of range, conflicting flags) and keep exit 2.login: cancelling the account prompt raised a CLIError inside login's try. The catch classified it aslogin_failedand rethrew it unchanged, so it exited 2.switch: its cancel already exited 1, because a catch rewraps it as a plainError. It now passes the exit code itself, so the convention doesn't depend on that catch. No behaviour change.docs/output-contract.md: the exit-code table now says 2 is for usage errors and 1 includes failures reported only on stderr. A note says that runtime failures usethis.error(msg, { exit: 1 }). The skill (skill.md, synced toskills/checkly/SKILL.md) drops "or another error reported only on stderr" from exit 2.Breaking changes (for the v10 release notes)
These now exit 1 instead of 2:
checkly account plan <key>with a key that is not in the plancheckly logincheckly skills <action>when the bundled action file cannot be readcheckly skills installwhen the skill file cannot be read or writtenTesting
oclif.exitfor each case. All four new assertions fail without the fix.e2e/__tests__/account-plan.spec.tsnow expects 1. It passes locally against production.🤖 Generated with Claude Code