Stared some RPC-related error cleanup; started work on ipa_server.rcp.xmlrpc plugin

This commit is contained in:
Jason Gerard DeRose
2008-11-24 21:34:01 -07:00
parent 237c16f0fd
commit 2d458a1233
5 changed files with 134 additions and 5 deletions

View File

@@ -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"'