summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-06-20 17:26:25 +0100
committerGitHub <noreply@github.com>2018-06-20 17:26:25 +0100
commit02bfc581f806f0a6a2864ca6b5c83e2ffd762619 (patch)
tree6b58021734c0de1f7068061de01e50a266e557b9 /synapse/handlers/room.py
parentFix inflight requests metric (incorrect name & traceback) (#3413) (diff)
parentAdd error code to room creation error (diff)
downloadsynapse-02bfc581f806f0a6a2864ca6b5c83e2ffd762619.tar.xz
Merge pull request #3399 from costacruise/master
Add error code to room creation error
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 2abd63ad05..ab72963d87 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -23,7 +23,7 @@ from synapse.types import UserID, RoomAlias, RoomID, RoomStreamToken
 from synapse.api.constants import (
     EventTypes, JoinRules, RoomCreationPreset
 )
-from synapse.api.errors import AuthError, StoreError, SynapseError
+from synapse.api.errors import AuthError, Codes, StoreError, SynapseError
 from synapse.util import stringutils
 from synapse.visibility import filter_events_for_client
 
@@ -115,7 +115,11 @@ class RoomCreationHandler(BaseHandler):
             )
 
             if mapping:
-                raise SynapseError(400, "Room alias already taken")
+                raise SynapseError(
+                    400,
+                    "Room alias already taken",
+                    Codes.ROOM_IN_USE
+                )
         else:
             room_alias = None