Skip to content

fix: use SfError.actions (array) instead of action (string)-W-16447880 - #908

Merged
WillieRuemmele merged 1 commit into
mainfrom
sl/W-16447880
Aug 5, 2026
Merged

fix: use SfError.actions (array) instead of action (string)-W-16447880#908
WillieRuemmele merged 1 commit into
mainfrom
sl/W-16447880

Conversation

@soridalac

Copy link
Copy Markdown
Contributor

Summary

  • Fixed applyErrorAction in packageUtils.ts to set SfError.actions (string array) instead of err['action'] (string), which the CLI framework
    ignores
  • Preserves any existing actions already set on the error before appending new ones
  • Updated unit test to validate actions on the SfError object itself, not just the function return value

Test plan

  • Unit tests pass (24/24) — validates actions are set as array and existing actions are preserved
  • Direct library test confirms result.actions is a string[] and result.action is undefined
  • E2E manual test: sf package installed list with a simulated INVALID_TYPE error renders "Try this:" in human output and "actions": [...]
    in --json output

Screenshot with --json and without --json

Screenshot 2026-08-04 at 2 08 22 PM

@W-16447880@

@WillieRuemmele
WillieRuemmele merged commit 06feca0 into main Aug 5, 2026
17 checks passed
@WillieRuemmele
WillieRuemmele deleted the sl/W-16447880 branch August 5, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants