diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-03-12 15:53:40 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-03-12 15:53:40 -0400 |
commit | b3eafe71b400a7a48bda5a456d53a9433ef838dd (patch) | |
tree | d2b9151f48eaabefa3eb48772aa370da7f5f8a5c /cmd2/exceptions.py | |
parent | d17f79428a41a5239c4fdbdf9745c294649f49e8 (diff) | |
download | cmd2-git-b3eafe71b400a7a48bda5a456d53a9433ef838dd.tar.gz |
Added Cmd2ShlexError
Diffstat (limited to 'cmd2/exceptions.py')
-rw-r--r-- | cmd2/exceptions.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd2/exceptions.py b/cmd2/exceptions.py index 1fffed1c..15787177 100644 --- a/cmd2/exceptions.py +++ b/cmd2/exceptions.py @@ -2,8 +2,17 @@ """Custom exceptions for cmd2. These are NOT part of the public API and are intended for internal use only.""" -class Cmd2ArgparseException(Exception): - """Custom exception class for when an argparse-decorated command has an error parsing its arguments""" +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 |