From 6f739bcf671ee3028ffeab736e7ea1ff16489907 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 3 Sep 2008 21:53:15 +0000 Subject: 244: Added unit tests for errors.ConversionError --- ipalib/errors.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ipalib/errors.py') diff --git a/ipalib/errors.py b/ipalib/errors.py index cf213d70..6f0941e2 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): -- cgit