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

Problem with the ExitCode enum #1653

Closed
giovannipizzi opened this issue Jun 18, 2018 · 1 comment
Closed

Problem with the ExitCode enum #1653

giovannipizzi opened this issue Jun 18, 2018 · 1 comment

Comments

@giovannipizzi
Copy link
Member

The changes introduced in #1648 are partially incorrect.

For instance, calling sys.exit(ExitCode.UNKNOWN)

  1. prints ExitCode.UNKNOWN on the screen before exiting (this is because ExitCode.UNKNOWN is a special type and not simply its value. One e.g. should do sys.exit(ExitCode.UNKNOWN.value). It would be ideal if we find a way to have an enum passing directly its values rather than going in the code and putting a .value everywhere, but I don't know if it's possible
  2. always exits with error code 1 as sys.exit() does not know how to get the value from that object

The same problem in e.g. echo_critical (that I would still like to be called echo_critical_exit ;-) ), even if point 2 is less apparent because ExitCode.CRITICAL is 1

@sphuber
Copy link
Contributor

sphuber commented Jun 18, 2018

Fixed in PR #1654

@sphuber sphuber closed this as completed Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants