diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-13 23:29:35 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-11-13 23:29:35 -0700 |
commit | f5594dd489317dc406d20f897fc720e0cf89c9d2 (patch) | |
tree | 6528f06ff5302907fcc59f6a786bc881d42b9489 /ipalib/errors.py | |
parent | 860d391f3e905e20ba3f409c92d98e68450f3137 (diff) | |
download | freeipa-f5594dd489317dc406d20f897fc720e0cf89c9d2.tar.gz freeipa-f5594dd489317dc406d20f897fc720e0cf89c9d2.tar.xz freeipa-f5594dd489317dc406d20f897fc720e0cf89c9d2.zip |
Started work on cleaning up how exceptions are caught and sys.exit() is called in ipalib.cli.CLI
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index c2d83e73..71a837e9 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -98,6 +98,7 @@ class IPAError(StandardError): """ format = None + faultCode = 1 def __init__(self, *args): self.args = args @@ -109,6 +110,16 @@ class IPAError(StandardError): return self.format % self.args +class InvocationError(IPAError): + pass + +class UnknownCommandError(InvocationError): + format = 'unknown command "%s"' + +class UnknownHelpError(InvocationError): + format = 'no command nor topic "%s"' + + class ArgumentError(IPAError): """ Raised when a command is called with wrong number of arguments. |