{ht dZddlmZGddeZGddeZGddeZGd d eZGd d eZGd deZ Gdde Z GddeZ GddeZ dS)zCustom exceptions for cmd2.)AnyceZdZdZdS)SkipPostcommandHookszoFor when a command has a failed bad enough to skip post command hooks, but not bad enough to print to the user.N__name__ __module__ __qualname____doc___/home/jenkins/workspace/simtester-sanitize/venv/lib/python3.11/site-packages/cmd2/exceptions.pyrr syyyyr rceZdZdZdS)Cmd2ArgparseErrorafA ``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. Nrr r r rrsr rceZdZdZdS)CommandSetRegistrationErrorz^For when an error occurs while a CommandSet is being added or removed from a cmd2 application.Nrr r r rrshhhhr rc6eZdZdZdddededdffdZxZS) CompletionErrora'Raised during tab completion operations to report any sort of error you want printed. This can also be used just to display a message, even if it's not an error. For instance, ArgparseCompleter raises CompletionErrors to display tab completion hints and sets apply_style to False so hints aren't colored like error text. Example use cases: - Reading a database to retrieve a tab completion data set failed - A previous command line argument that determines the data set being completed is invalid - Tab completion hints T) apply_styleargsrreturnNcB||_tj|dS)a1Initialize CompletionError instance. :param apply_style: If True, then ansi.style_error will be applied to the message text when printed. Set to False in cases where the message text already has the desired style. Defaults to True. N)rsuper__init__)selfrr __class__s r rzCompletionError.__init__(s''$r )rrr r rboolr __classcell__rs@r rrsk  8<    c               r rc0eZdZdZdededdffd ZxZS)PassThroughExceptionzNormally all unhandled exceptions raised during commands get printed to the user. This class is used to wrap an exception that should be raised instead of printed. r wrapped_exrNcB||_tj|dS)zqInitialize PassThroughException instance. :param wrapped_ex: the exception that will be raised. N)r!rr)rr!rrs r rzPassThroughException.__init__:s& %$r )rrr r r BaseExceptionrrrs@r r r 4s\  c }           r r ceZdZdZdS)Cmd2ShlexErrorzJRaised when shlex fails to parse a command line string in StatementParser.Nrr r r r%r%HsTTTTr r%ceZdZdZdS)EmbeddedConsoleExitz3Custom exception class for use with the py command.Nrr r r r'r'Ls====r r'ceZdZdZdS)EmptyStatementzPCustom exception class for handling behavior when the user just presses .Nrr r r r)r)PsZZZZr r)ceZdZdZdS)RedirectionErrorzCCustom exception class for when redirecting or piping output fails.Nrr r r r+r+TsMMMMr r+N)r typingr Exceptionrrrrr r% SystemExitr'r)r+r r r r/s!!zzzzz9zzz,iiiii)iii     i   2      9    (UUUUUYUUU>>>>>*>>>[[[[[Y[[[NNNNNyNNNNNr