diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-03 21:53:15 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-03 21:53:15 +0000 |
commit | 6f739bcf671ee3028ffeab736e7ea1ff16489907 (patch) | |
tree | 772964f2614922c76d357365d55ebb36dfa2b453 /ipalib/errors.py | |
parent | 390c1aa4ba9d2c54ac4c737c128f0561d14b58ab (diff) | |
download | freeipa-6f739bcf671ee3028ffeab736e7ea1ff16489907.tar.gz freeipa-6f739bcf671ee3028ffeab736e7ea1ff16489907.tar.xz freeipa-6f739bcf671ee3028ffeab736e7ea1ff16489907.zip |
244: Added unit tests for errors.ConversionError
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index cf213d70f..6f0941e20 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -129,11 +129,15 @@ class ValidationError(IPAError): class ConversionError(ValidationError): - def __init__(self, name, value, type_, position): - self.type = type_ - self.position = position - ValidationError.__init__(self, name, value, type_.conversion_error) + """ + Raised when a value cannot be converted to the correct type. + """ + def __init__(self, name, value, type_, index=None): + self.type = type_ + ValidationError.__init__(self, name, value, type_.conversion_error, + index=index, + ) class NormalizationError(ValidationError): |