fix(web): edit and recover refusals reach the caller - #341
Merged
Conversation
Five more guards. Neither file has an enclosing try, so these call
displayErrorAndExit directly rather than throwing — the same shape editCommand
already uses a few lines below its own guards for the local-key failure. Same
single ending either way: the terminal still gets its text, the browser gets
the command-error page, the process still exits 1.
editCommand could not read keep.lock NO_KEEP_FILE
no active branch NO_ACTIVE_BRANCH
authentication failed AUTH_FAILED (with project and
branch context, which this file
already threads to the screen)
recoverCommand sign-in failed AUTH_FAILED
no organizations NO_ORGANIZATIONS (minted: the
account belongs to none, so
re-authenticating cannot help —
distinct from a permission
refusal or a missing project)
ONLY TWO OF recoverCommand'S SEVEN EXITS ARE INCLUDED, and the reason is worth
recording. The other five sit AFTER `if (options.web) { ... return; }`, so they
are unreachable under --web by construction and converting them would change
terminal-only paths for no gain. The two here run before that branch.
Suite: 1851 pass, 0 fail.
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.
Five more guards in the refusal class.
Neither file has an enclosing try, so these call
displayErrorAndExitdirectly rather than throwing — the same shapeeditCommandalready uses a few lines below its own guards for the local-key failure. Same single ending either way: terminal still gets its text, browser gets thecommand-errorpage, process still exits 1.editCommandNO_KEEP_FILENO_ACTIVE_BRANCHAUTH_FAILED(with project/branch context this file already threads to the screen)recoverCommandAUTH_FAILEDNO_ORGANIZATIONS(minted)NO_ORGANIZATIONSis minted rather than reused: the account belongs to none, so re-authenticating cannot help — distinct from a permission refusal or a missing project.Only two of recover's seven exits are here
The other five sit after
if (options.web) { ... return; }, so they are unreachable under--webby construction. Converting them would change terminal-only paths for no gain. The two included run before that branch.Also checked, per the pattern that has now bitten three times: none of the remaining files carries a stale "not reachable from argv" docblock. That class is closed at
kick,org,invite.Suite: 1851 pass, 0 fail.