summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-02-26 13:40:25 +0000
committerDavid Baker <dave@matrix.org>2016-02-26 13:40:25 +0000
commit413e36b17afd49d0383cbfd8b8104e9f52a35d98 (patch)
tree8f9fad5d45310e0acf5059e5867a57b5889e694b
parentEmpty to commit to force re-test (diff)
parentMerge pull request #608 from gergelypolonkai/syn-638 (diff)
downloadsynapse-413e36b17afd49d0383cbfd8b8104e9f52a35d98.tar.xz
Merge remote-tracking branch 'origin/develop' into dbkr/send_inviter_member_event
-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):