From 10747103fa3748677e6e1948977de1313fe25bc9 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 13 Jan 2009 02:17:16 -0700 Subject: New Param: implemented a base Param._convert_scalar() method; added Param.type_error attribute for ConversionError message --- ipalib/errors2.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ipalib/errors2.py') diff --git a/ipalib/errors2.py b/ipalib/errors2.py index 81b1fb2e..4c8acd5d 100644 --- a/ipalib/errors2.py +++ b/ipalib/errors2.py @@ -481,9 +481,17 @@ class RequirementError(InvocationError): class ConversionError(InvocationError): """ **3006** Raised when parameter value can't be converted to correct type. + + For example: + + >>> raise ConversionError(name='age', error='must be an integer') + Traceback (most recent call last): + ... + ConversionError: invalid 'age': must be an integer """ errno = 3006 + format = _('invalid %(name)r: %(error)s') class ValidationError(InvocationError): -- cgit