Skip to content
Snippets Groups Projects
Unverified Commit 326c893d authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Kill off RegistrationError (#6691)

This is pretty pointless. Let's just use SynapseError.
parent 2d07c737
Branches
Tags
No related merge requests found
Remove redundant RegistrationError class.
...@@ -158,12 +158,6 @@ class UserDeactivatedError(SynapseError): ...@@ -158,12 +158,6 @@ class UserDeactivatedError(SynapseError):
) )
class RegistrationError(SynapseError):
"""An error raised when a registration event fails."""
pass
class FederationDeniedError(SynapseError): class FederationDeniedError(SynapseError):
"""An error raised when the server tries to federate with a server which """An error raised when the server tries to federate with a server which
is not on its federation whitelist. is not on its federation whitelist.
......
...@@ -20,13 +20,7 @@ from twisted.internet import defer ...@@ -20,13 +20,7 @@ from twisted.internet import defer
from synapse import types from synapse import types
from synapse.api.constants import MAX_USERID_LENGTH, LoginType from synapse.api.constants import MAX_USERID_LENGTH, LoginType
from synapse.api.errors import ( from synapse.api.errors import AuthError, Codes, ConsentNotGivenError, SynapseError
AuthError,
Codes,
ConsentNotGivenError,
RegistrationError,
SynapseError,
)
from synapse.config.server import is_threepid_reserved from synapse.config.server import is_threepid_reserved
from synapse.http.servlet import assert_params_in_dict from synapse.http.servlet import assert_params_in_dict
from synapse.replication.http.login import RegisterDeviceReplicationServlet from synapse.replication.http.login import RegisterDeviceReplicationServlet
...@@ -165,7 +159,7 @@ class RegistrationHandler(BaseHandler): ...@@ -165,7 +159,7 @@ class RegistrationHandler(BaseHandler):
Returns: Returns:
Deferred[str]: user_id Deferred[str]: user_id
Raises: Raises:
RegistrationError if there was a problem registering. SynapseError if there was a problem registering.
""" """
yield self.check_registration_ratelimit(address) yield self.check_registration_ratelimit(address)
...@@ -182,7 +176,7 @@ class RegistrationHandler(BaseHandler): ...@@ -182,7 +176,7 @@ class RegistrationHandler(BaseHandler):
if not was_guest: if not was_guest:
try: try:
int(localpart) int(localpart)
raise RegistrationError( raise SynapseError(
400, "Numeric user IDs are reserved for guest users." 400, "Numeric user IDs are reserved for guest users."
) )
except ValueError: except ValueError:
......
...@@ -269,8 +269,6 @@ class RegistrationTestCase(unittest.HomeserverTestCase): ...@@ -269,8 +269,6 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
one will be randomly generated. one will be randomly generated.
Returns: Returns:
A tuple of (user_id, access_token). A tuple of (user_id, access_token).
Raises:
RegistrationError if there was a problem registering.
""" """
if localpart is None: if localpart is None:
raise SynapseError(400, "Request must include user id") raise SynapseError(400, "Request must include user id")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment