Better error message on __setitem__ failure (#22)
repr helps distinguish between strings and integers
This commit is contained in:
parent
632a78601d
commit
4f839e8fdb
|
@ -46,7 +46,7 @@ class Model(dict):
|
|||
try:
|
||||
self.validate(mutation)
|
||||
except exceptions.ValidationError as exc:
|
||||
msg = ("Unable to set '%s' to '%s'. Reason: %s"
|
||||
msg = ("Unable to set '%s' to %r. Reason: %s"
|
||||
% (key, value, str(exc)))
|
||||
raise exceptions.InvalidOperation(msg)
|
||||
|
||||
|
|
Loading…
Reference in New Issue