forked from MirrorHub/synapse
Add error code to room creation error
This error code is mentioned in the documentation at https://matrix.org/docs/api/client-server/#!/Room32creation/createRoom
This commit is contained in:
parent
1032393dfb
commit
19cd3120ec
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue