mirror of
https://github.com/matrix-org/synapse.git
synced 2025-08-19 13:31:09 +02:00
Print expected-vs-actual data types on typecheck failure from check_json()
This commit is contained in:
parent
e32cfed1d8
commit
9973298e2a
@ -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…
x
Reference in New Issue
Block a user