mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-14 15:05:00 -05:00
Started work on cleaning up how exceptions are caught and sys.exit() is called in ipalib.cli.CLI
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user