Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check oclif exit code first #466

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Conversation

mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Dec 8, 2023

SfError adds exitCode: 1 by default which means that our configured exit codes for oclif-level errors are being ignored. This PR switches the logic to check for oclif.exit before checking exitCode

[skip-validate-pr]

@mshanemc
Copy link
Contributor

QA:
[linked the lib into nightly from installer]

✅ oclif throwing from flag validation => 2
✅ respects process.exitCode when set by a plugin (not throwing an error)
✅ respects exitCode set via 4th param of a thrown SfError

❌ you set a process.exitCode and then throw a native Error like

process.exitCode = 25;
throw new Error('custom error')

(exit code becomes turns into 1)

@mshanemc mshanemc merged commit 6ac36aa into main Dec 14, 2023
40 checks passed
@mshanemc mshanemc deleted the mdonnalley/oclif-exit-first branch December 14, 2023 16:08
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