-
Notifications
You must be signed in to change notification settings - Fork 456
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(cli): improve cli error handling #1687
Conversation
ansgarm
commented
Apr 5, 2022
- chore(deps): update yargs type defs
- fix(cli): be explicit about yargs not exiting the process on failure
- fix(cli): make stack positional argument optional
- fix(cli): exit the process on uncaught errors from yargs handlers
- fix(cli): throw Usage error instead of local process.exit()
- refactor(cli): Don't catch errors locally in command handlers as they are now caught properly on a global level in .fail()
Exiting the process has already implicitly been disabled by passing a callback to `.fail()`. Now this is more explicit.
previously this caused .fail() to be called with a message (but no error) which in turn caused debug information to be printed without cancelling the process itself. Another commit will fix this and stop everything if argument validation fails
and print validation messages and abort in that case as well
… are now caught properly on a global level in .fail()
…ks things after changing positional arguments to optional
CI currently fails because somehow yargs tries to run the command when returning completions for it (see yargs/yargs#1965). I'm going to implement the workaround mentioned in the issue in a base command class. |
…ell completions are prepared
I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |