cmd2.exceptions¶
Custom cmd2 exceptions
-
class
cmd2.exceptions.
SkipPostcommandHooks
¶ Custom exception class for when a command has a failure bad enough to skip post command hooks, but not bad enough to print the exception to the user.
-
class
cmd2.exceptions.
Cmd2ArgparseError
¶ A
SkipPostcommandHooks
exception for when a command fails to parse its arguments. Normally argparse raises a SystemExit exception in these cases. To avoid stopping the command loop, catch the SystemExit and raise this instead. If you still need to run post command hooks after parsing fails, just return instead of raising an exception.
-
class
cmd2.exceptions.
CommandSetRegistrationError
¶ Exception that can be thrown when an error occurs while a CommandSet is being added or removed from a cmd2 application.