diff options
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index 71a837e9c..a01082504 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -113,9 +113,33 @@ class IPAError(StandardError): class InvocationError(IPAError): pass + class UnknownCommandError(InvocationError): format = 'unknown command "%s"' +def _(text): + return text + + +class HandledError(StandardError): + """ + Base class for errors that can be raised across a remote procecdure call. + """ + def __init__(self, message=None, **kw): + self.kw = kw + if message is None: + message = self.format % kw + StandardError.__init__(self, message) + + +class CommandError(HandledError): + format = _('Unknown command %(name)r') + + +class RemoteCommandError(HandledError): + format = 'Server at %(uri)r has no command %(command)r' + + class UnknownHelpError(InvocationError): format = 'no command nor topic "%s"' |