diff --git a/synapse/rest/client/account.py b/synapse/rest/client/account.py
index 59dbad3582..7d6c0afd9a 100644
--- a/synapse/rest/client/account.py
+++ b/synapse/rest/client/account.py
@@ -350,6 +350,7 @@ class EmailThreepidRequestTokenRestServlet(RestServlet):
raise SynapseError(
400,
"Adding an email to your account is disabled on this server",
+ Codes.THREEPID_MEDIUM_NOT_SUPPORTED,
)
body = parse_and_validate_json_object_from_request(
@@ -456,6 +457,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
raise SynapseError(
400,
"Adding phone numbers to user account is not supported by this homeserver",
+ Codes.THREEPID_MEDIUM_NOT_SUPPORTED,
)
ret = await self.identity_handler.requestMsisdnToken(
@@ -498,7 +500,9 @@ class AddThreepidEmailSubmitTokenServlet(RestServlet):
"Adding emails have been disabled due to lack of an email config"
)
raise SynapseError(
- 400, "Adding an email to your account is disabled on this server"
+ 400,
+ "Adding an email to your account is disabled on this server",
+ Codes.THREEPID_MEDIUM_NOT_SUPPORTED,
)
sid = parse_string(request, "sid", required=True)
|