diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-07 03:38:49 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-08-07 03:38:49 +0000 |
commit | fadbae642053565be1d10bc5d6b40b151a97ff16 (patch) | |
tree | 1ae0cd72ef0b97ca5ffc6419545efd510256782b /ipalib/errors.py | |
parent | f904cb0422194dc55cf74366145b2cf20299b657 (diff) | |
download | freeipa-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.py | 20 |
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' |