fix: add missing throw before messages.createError() calls#1548
Open
ZLeventer wants to merge 1 commit intosalesforcecli:mainfrom
Open
fix: add missing throw before messages.createError() calls#1548ZLeventer wants to merge 1 commit intosalesforcecli:mainfrom
ZLeventer wants to merge 1 commit intosalesforcecli:mainfrom
Conversation
Two locations create an SfError but silently discard it instead of throwing, so error conditions are swallowed and execution continues: - deploy/cancel.ts:88 — when the deployment is already in a terminal state (Canceled/Failed/Succeeded), the guard creates the error but never throws it, allowing the cancel attempt to proceed on a finished job - convertBehavior.ts:63 — when getPackageDirectoriesForPreset finds no matching component sets, the error is created and dropped; the function returns an empty array instead of surfacing the failure to the caller
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.
Summary
Two locations call
messages.createError()but neverthrowthe result, silently swallowing errors and allowing execution to continue past conditions that should halt.src/commands/project/deploy/cancel.ts:88When a deployment is already in a terminal state (
Canceled,Failed,Succeeded,SucceededPartial), this guard is supposed to prevent the cancel attempt. Withoutthrow, the error is created and discarded, and the cancel proceeds on an already-finished job.src/utils/convertBehavior.ts:63When
getPackageDirectoriesForPresetfinds no matching component sets for the given preset, it should surface anoTargetTypeserror. Withoutthrow, the error is dropped and the function silently returns an empty array.Both cases follow the same
throw messages.createError(...)pattern used consistently everywhere else in the codebase.Test plan
yarn buildpasses