In commands, add a separate command error to signal execution errors
jonls opened this issue · 1 comments
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.