summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-17 15:27:45 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-17 15:27:45 +0100
commit9973298e2ac4039b96e923faa984b400ea720b7f (patch)
tree41d702e8a1c20e2b2dc0dc9d9c745ff4d825c3bd
parentInitial pass at a RoomStore test (diff)
downloadsynapse-9973298e2ac4039b96e923faa984b400ea720b7f.tar.xz
Print expected-vs-actual data types on typecheck failure from check_json()
-rw-r--r--synapse/api/events/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py
index 72c493db57..4fe0608016 100644
--- a/synapse/api/events/__init__.py
+++ b/synapse/api/events/__init__.py
@@ -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