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

Bolt should exit with code 1 when erroring unless we receive invalid input #2998

Closed
lucywyman opened this issue Aug 26, 2021 · 1 comment
Closed
Labels
Bug Bug reports and fixes.

Comments

@lucywyman
Copy link
Contributor

lucywyman commented Aug 26, 2021

Describe the Bug

We currently will always exit with code 2 when Bolt errors, when exit code 2 is intended to be used when the command can't be parsed, or for things like permissions issues rather than errors from Bolt itself. Bolt errors should result in exit code 1.

@lucywyman lucywyman added the Bug Bug reports and fixes. label Aug 26, 2021
@lucywyman lucywyman added this to 📝 To Do in Bolt Kanban via automation Aug 26, 2021
lucywyman added a commit to lucywyman/bolt that referenced this issue Aug 26, 2021
Previously, Bolt would exit with code 1 for any CLI parsing errors and
code 2 for any other errors raised while executing Bolt, which is
[backwards from industry
standards](https://tldp.org/LDP/abs/html/exitcodes.html). This modifies
Bolt to exit with 1 whenever it is not successful. It'd be great to
eventually exit with 2 whenever we raise `Bolt::CLIError`, but Ruby
doesn't seem to have a way to set the exit code when raising errors and
any larger changes seem like more work than they're worth.

!bug

* **Return exit code 1 instead of 2 when Bolt errors** ([puppetlabs#2998](puppetlabs#2998))

  Bolt will now exit with code 1 instead of 2 whenever a Bolt operation
  fails.
beechtom added a commit that referenced this issue Sep 1, 2021
(GH-2998) Exit with code 1 when Bolt errors
@beechtom
Copy link
Contributor

beechtom commented Sep 1, 2021

Closed by #2999

@beechtom beechtom closed this as completed Sep 1, 2021
@beechtom beechtom removed this from 📝 To Do in Bolt Kanban Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug reports and fixes.
Projects
None yet
Development

No branches or pull requests

2 participants