snakeoil.cli.exceptions module

Command-line related exceptions

exception snakeoil.cli.exceptions.ExitException(code=None)[source]

Bases: Exception

Generic exception for exiting with a specific return message or status.

Used in cases where we might want to catch the exception and show a traceback for debugging. Note that this is used in place of SystemExit so we can differentiate between third party code using SystemExit and our own exit method to aid in debugging when necessary.

exception snakeoil.cli.exceptions.UserException(msg, verbosity=None)[source]

Bases: Exception

Generic exception with a sane string for non-debug, user-facing output.

msg(verbosity=0)[source]
snakeoil.cli.exceptions.find_user_exception(exc)[source]

Find the UserException related to a given exception if one exists.