Started work on cleaning up how exceptions are caught and sys.exit() is called in ipalib.cli.CLI

This commit is contained in:
Jason Gerard DeRose
2008-11-13 23:29:35 -07:00
parent 860d391f3e
commit f5594dd489
3 changed files with 68 additions and 46 deletions
+11
View File
@@ -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.