Fix xs:error type decoding/encoding
This commit is contained in:
parent
1a06be7477
commit
588f17a1f9
|
@ -549,6 +549,11 @@ class XsdAtomicBuiltin(XsdAtomic):
|
|||
yield self.decode_error(validation, obj, self.to_python, reason=str(err))
|
||||
yield None
|
||||
return
|
||||
except TypeError:
|
||||
# xs:error type (eg. an XSD 1.1 type alternative used to catch invalid values)
|
||||
yield self.validation_error(validation, "Invalid value {!r}".format(obj))
|
||||
yield None
|
||||
return
|
||||
|
||||
for validator in self.validators:
|
||||
for error in validator(result):
|
||||
|
@ -587,6 +592,10 @@ class XsdAtomicBuiltin(XsdAtomic):
|
|||
yield self.encode_error(validation, obj, self.from_python)
|
||||
yield None
|
||||
return
|
||||
except TypeError:
|
||||
yield self.validation_error(validation, "Invalid value {!r}".format(obj))
|
||||
yield None
|
||||
return
|
||||
|
||||
for validator in self.validators:
|
||||
for error in validator(obj):
|
||||
|
|
Loading…
Reference in New Issue