summaryrefslogtreecommitdiff
path: root/cmd2/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/exceptions.py')
-rw-r--r--cmd2/exceptions.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd2/exceptions.py b/cmd2/exceptions.py
index 747e2368..15787177 100644
--- a/cmd2/exceptions.py
+++ b/cmd2/exceptions.py
@@ -2,6 +2,20 @@
"""Custom exceptions for cmd2. These are NOT part of the public API and are intended for internal use only."""
+class Cmd2ArgparseError(Exception):
+ """
+ Custom exception class for when a command has an error parsing its arguments.
+ This can be raised by argparse decorators or the command functions themselves.
+ The main use of this exception is to tell cmd2 not to run Postcommand hooks.
+ """
+ pass
+
+
+class Cmd2ShlexError(Exception):
+ """Raised when shlex fails to parse a command line string in StatementParser"""
+ pass
+
+
class EmbeddedConsoleExit(SystemExit):
"""Custom exception class for use with the py command."""
pass