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

In commands, add a separate command error to signal execution errors #74

Closed
jonls opened this issue Jun 2, 2016 · 1 comment
Closed

Comments

@jonls
Copy link
Contributor

jonls commented Jun 2, 2016

Currently the CommandError exception is available to signal that a command failed. However, this exception causes the argument parser to print out usage information which is only appropriate if the error was caused by incorrect arguments supplied by the user. In other cases, the command may wish to signal an error that does not cause usage information to be printed. Most commands where errors are possible either raise an exception or let an existing exception bubble up. This accomplishes the goal of exiting the command with an error code but does not provide a good error message to the user. Ideally, the stack trace of the exception should be logged (at "debug" level) and a good error message should be logged at "error" level.

jonls added a commit that referenced this issue Jun 24, 2016
Fixes #74 by adding the fail() method on Command which can be used
to make the command fail without printing usage information.
Optionally, the exception that caused the failure is logged to
the debug level.
spikeliu pushed a commit to spikeliu/psamm that referenced this issue Jun 29, 2016
Fixes zhanglab#74 by adding the fail() method on Command which can be used
to make the command fail without printing usage information.
Optionally, the exception that caused the failure is logged to
the debug level.
@jonls
Copy link
Contributor Author

jonls commented Jun 29, 2016

Fixed in #96

@jonls jonls closed this as completed Jun 29, 2016
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

1 participant