Slightly improved error formatting
This is a partial response to #106. We no longer call errors "unexpected errors" since there's really no way, currently, to distinguish between "expected" and "unexpected" errors. Instead, for commands that don't use the logging module for output, errors are formatted like:
error:
ZeroDivisionError: division by zero
run again with --debug to view the full traceback, or with --pdb to drop into a debugger
That is, it gives the exception name and message, and then adds the "run again with --debug..." message on a separate line, so it doesn't get mixed in with the original error message.
If running with --debug
it doesn't display the hint message because
it's now redundant.
If the command uses logging (e.g. training, preprocessing, really most
commands now) the error is instead sent through the logging module using
log.error()
or log.exception()
in the case of --debug
. The same
"run again with --debug" hint is given, but now on a separate log line.