summary refs log tree commit diff
path: root/synapse/api/errors.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-17 17:28:38 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-17 17:28:38 +0000
commite6ae24ec8b1ad404a3938c1666f3806f8bda7e03 (patch)
tree71b98b9ebed34bee3a580853d6f0707fad7da6b2 /synapse/api/errors.py
parentMerge pull request #5589 from matrix-org/erikj/admin_exfiltrate_data (diff)
parentReturn a different error from Invalid Password when a user is deactivated (#5... (diff)
downloadsynapse-e6ae24ec8b1ad404a3938c1666f3806f8bda7e03.tar.xz
Return a different error from Invalid Password when a user is deactivated (#5674)
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r--synapse/api/errors.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py

index 1e8fed0ae6..c293135b51 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py
@@ -147,6 +147,22 @@ class ConsentNotGivenError(SynapseError): return cs_error(self.msg, self.errcode, consent_uri=self._consent_uri) +class UserDeactivatedError(SynapseError): + """The error returned to the client when the user attempted to access an + authenticated endpoint, but the account has been deactivated. + """ + + def __init__(self, msg): + """Constructs a UserDeactivatedError + + Args: + msg (str): The human-readable error message + """ + super(UserDeactivatedError, self).__init__( + code=http_client.FORBIDDEN, msg=msg, errcode=Codes.UNKNOWN + ) + + class RegistrationError(SynapseError): """An error raised when a registration event fails."""