summary refs log tree commit diff
path: root/synapse/rest/client/v1/login.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-03-01 09:43:27 +0000
committerErik Johnston <erik@matrix.org>2016-03-01 09:43:27 +0000
commit903fb34b39cd750050b4c89d9c0f5492652b8fcd (patch)
tree7e74b35c054227b2897ed46bccfb2b4de40f47f6 /synapse/rest/client/v1/login.py
parentReport size of ExpiringCache (diff)
parentMerge pull request #607 from matrix-org/dbkr/send_inviter_member_event (diff)
downloadsynapse-903fb34b39cd750050b4c89d9c0f5492652b8fcd.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/expiring_cache_size
Diffstat (limited to 'synapse/rest/client/v1/login.py')
-rw-r--r--synapse/rest/client/v1/login.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/login.py b/synapse/rest/client/v1/login.py
index 79101106ac..f13272da8e 100644
--- a/synapse/rest/client/v1/login.py
+++ b/synapse/rest/client/v1/login.py
@@ -404,10 +404,12 @@ def _parse_json(request):
     try:
         content = json.loads(request.content.read())
         if type(content) != dict:
-            raise SynapseError(400, "Content must be a JSON object.")
+            raise SynapseError(
+                400, "Content must be a JSON object.", errcode=Codes.BAD_JSON
+            )
         return content
     except ValueError:
-        raise SynapseError(400, "Content not JSON.")
+        raise SynapseError(400, "Content not JSON.", errcode=Codes.NOT_JSON)
 
 
 def register_servlets(hs, http_server):