diff options
| author | Godefroid Chapelle <gotcha@bubblenet.be> | 2009-11-30 11:21:26 +0000 |
|---|---|---|
| committer | Godefroid Chapelle <gotcha@bubblenet.be> | 2009-11-30 11:21:26 +0000 |
| commit | 8cb44f4e1c0b6de7a860925238b892d60e839bd3 (patch) | |
| tree | 28f93f19ad3aed0d52da55f32ee74f9524e11b58 /src/zope/schema/_bootstrapfields.py | |
| parent | 6b712cedb5b82ee7f16c9fbb253c9ed3cf3b22c9 (diff) | |
| download | zope-schema-8cb44f4e1c0b6de7a860925238b892d60e839bd3.tar.gz | |
advertise which field is invalid
Diffstat (limited to 'src/zope/schema/_bootstrapfields.py')
| -rw-r--r-- | src/zope/schema/_bootstrapfields.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zope/schema/_bootstrapfields.py b/src/zope/schema/_bootstrapfields.py index 126232e..4634329 100644 --- a/src/zope/schema/_bootstrapfields.py +++ b/src/zope/schema/_bootstrapfields.py @@ -162,7 +162,7 @@ class Field(Attribute): def _validate(self, value): if self._type is not None and not isinstance(value, self._type): - raise WrongType(value, self._type) + raise WrongType(value, self._type, self.__name__) if not self.constraint(value): raise ConstraintNotSatisfied(value) @@ -283,7 +283,7 @@ class Text(MinMaxLen, Field): >>> t.fromUnicode("foo x spam") Traceback (most recent call last): ... - WrongType: ('foo x spam', <type 'unicode'>) + WrongType: ('foo x spam', <type 'unicode'>, '') >>> t.fromUnicode(u"foo x spam") u'foo x spam' >>> t.fromUnicode(u"foo spam") |
