summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-08-20 10:39:41 -0400
committerGitHub <noreply@github.com>2020-08-20 10:39:41 -0400
commit592cdf73be50af837d8c255ebcb5fbcd429c2954 (patch)
tree7949bf763b54ec4b874b75df1dd6638ac83653d0 /synapse/handlers/register.py
parentUse the JSON encoder without whitespace in more places. (#8124) (diff)
downloadsynapse-592cdf73be50af837d8c255ebcb5fbcd429c2954.tar.xz
Improve the error code when trying to register using a name reserved for guests. (#8135)
Diffstat (limited to '')
-rw-r--r--synapse/handlers/register.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 999bc6efb5..ccd96e4626 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -124,7 +124,9 @@ class RegistrationHandler(BaseHandler):
             try:
                 int(localpart)
                 raise SynapseError(
-                    400, "Numeric user IDs are reserved for guest users."
+                    400,
+                    "Numeric user IDs are reserved for guest users.",
+                    errcode=Codes.INVALID_USERNAME,
                 )
             except ValueError:
                 pass