summaryrefslogtreecommitdiffstats
path: root/ipalib/errors.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-08-07 03:38:49 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-08-07 03:38:49 +0000
commitfadbae642053565be1d10bc5d6b40b151a97ff16 (patch)
tree1ae0cd72ef0b97ca5ffc6419545efd510256782b /ipalib/errors.py
parentf904cb0422194dc55cf74366145b2cf20299b657 (diff)
downloadfreeipa-fadbae642053565be1d10bc5d6b40b151a97ff16.tar.gz
freeipa-fadbae642053565be1d10bc5d6b40b151a97ff16.tar.xz
freeipa-fadbae642053565be1d10bc5d6b40b151a97ff16.zip
72: Started work on public.opt class; added corresponding unit tests
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r--ipalib/errors.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py
index b86ffcdbc..6b1a898a3 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -45,6 +45,26 @@ class IPAError(Exception):
return self.msg % self.kw
+class ValidationError(IPAError):
+ msg = 'invalid %r value %r: %s'
+
+ def __init__(self, name, value, error):
+ self.name = name
+ self.value = value
+ self.error = error
+ super(ValidationError, self).__init__(name, value, error)
+
+class NormalizationError(ValidationError):
+ def __init__(self, name, value, type):
+ self.type = type
+ super(NormalizationError, self).__init__(name, value,
+ 'not %r' % type
+ )
+
+
+
+class ValidationRuleError(ValidationError):
+ msg = '%r is invalid %r: %s'