diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-17 15:27:45 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-17 15:27:45 +0100 |
commit | 9973298e2ac4039b96e923faa984b400ea720b7f (patch) | |
tree | 41d702e8a1c20e2b2dc0dc9d9c745ff4d825c3bd /synapse/api | |
parent | Initial pass at a RoomStore test (diff) | |
download | synapse-9973298e2ac4039b96e923faa984b400ea720b7f.tar.xz |
Print expected-vs-actual data types on typecheck failure from check_json()
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/events/__init__.py | 3 |
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 |