From 14a0658464b0a4696a2788692610a7fdade2fdbd Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 7 Aug 2008 06:23:02 +0000 Subject: 76: Fleshed out opt.validate(); added corresponding unit tests --- ipalib/errors.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'ipalib/errors.py') diff --git a/ipalib/errors.py b/ipalib/errors.py index 6b1a898a..f1162827 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -54,6 +54,7 @@ class ValidationError(IPAError): self.error = error super(ValidationError, self).__init__(name, value, error) + class NormalizationError(ValidationError): def __init__(self, name, value, type): self.type = type @@ -62,9 +63,10 @@ class NormalizationError(ValidationError): ) - -class ValidationRuleError(ValidationError): - msg = '%r is invalid %r: %s' +class RuleError(ValidationError): + def __init__(self, name, value, rule, error): + self.rule = rule + super(RuleError, self).__init__(name, value, error) -- cgit