From b3eafe71b400a7a48bda5a456d53a9433ef838dd Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 12 Mar 2020 15:53:40 -0400 Subject: Added Cmd2ShlexError --- cmd2/exceptions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cmd2/exceptions.py') 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 -- cgit v1.2.1