forked from MirrorHub/synapse
Print expected-vs-actual data types on typecheck failure from check_json()
This commit is contained in:
parent
e32cfed1d8
commit
9973298e2a
1 changed files with 2 additions and 1 deletions
|
@ -154,7 +154,8 @@ class SynapseEvent(JsonEncodedObject):
|
|||
return "Missing %s key" % key
|
||||
|
||||
if type(content[key]) != type(template[key]):
|
||||
return "Key %s is of the wrong type." % key
|
||||
return "Key %s is of the wrong type (got %s, want %s)" % (
|
||||
key, type(content[key]), type(template[key]))
|
||||
|
||||
if type(content[key]) == dict:
|
||||
# we must go deeper
|
||||
|
|
Loading…
Reference in a new issue