summaryrefslogtreecommitdiffstats
path: root/ipalib/errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r--ipalib/errors.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py
index 724654ff..6dd6eb01 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -117,6 +117,9 @@ class InvocationError(IPAError):
class UnknownCommandError(InvocationError):
format = 'unknown command "%s"'
+class NoSuchNamespaceError(InvocationError):
+ format = 'api has no such namespace: %s'
+
def _(text):
return text
@@ -231,8 +234,19 @@ class RegistrationError(IPAError):
class NameSpaceError(RegistrationError):
+ """
+ Raised when name is not a valid Python identifier for use for use as
+ the name of NameSpace member.
+ """
msg = 'name %r does not re.match %r'
+ def __init__(self, name, regex):
+ self.name = name
+ self.regex = regex
+
+ def __str__(self):
+ return self.msg % (self.name, self.regex)
+
class SubclassError(RegistrationError):
"""