summary refs log tree commit diff
path: root/synapse/api/errors.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-23 12:21:23 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-23 12:22:28 +0100
commit476cc03d7a6984a37e446341b7f2c5df9e16b99d (patch)
treeab0eced5327d0ea3d821507b15c51ad0b97b3856 /synapse/api/errors.py
parentMerge commit 'a27c1fd74' into anoa/dinsic_release_1_31_0 (diff)
parentAdd type hints to groups code. (#9393) (diff)
downloadsynapse-476cc03d7a6984a37e446341b7f2c5df9e16b99d.tar.xz
Merge commit 'd2f0ec12d' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r--synapse/api/errors.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py

index 90bb01f414..a71e518f90 100644 --- a/synapse/api/errors.py +++ b/synapse/api/errors.py
@@ -391,8 +391,7 @@ class InvalidCaptchaError(SynapseError): class LimitExceededError(SynapseError): - """A client has sent too many requests and is being throttled. - """ + """A client has sent too many requests and is being throttled.""" def __init__( self, @@ -409,8 +408,7 @@ class LimitExceededError(SynapseError): class RoomKeysVersionError(SynapseError): - """A client has tried to upload to a non-current version of the room_keys store - """ + """A client has tried to upload to a non-current version of the room_keys store""" def __init__(self, current_version: str): """ @@ -427,7 +425,9 @@ class UnsupportedRoomVersionError(SynapseError): def __init__(self, msg: str = "Homeserver does not support this room version"): super().__init__( - code=400, msg=msg, errcode=Codes.UNSUPPORTED_ROOM_VERSION, + code=400, + msg=msg, + errcode=Codes.UNSUPPORTED_ROOM_VERSION, ) @@ -462,8 +462,7 @@ class IncompatibleRoomVersionError(SynapseError): class PasswordRefusedError(SynapseError): - """A password has been refused, either during password reset/change or registration. - """ + """A password has been refused, either during password reset/change or registration.""" def __init__( self, @@ -471,7 +470,9 @@ class PasswordRefusedError(SynapseError): errcode: str = Codes.WEAK_PASSWORD, ): super().__init__( - code=400, msg=msg, errcode=errcode, + code=400, + msg=msg, + errcode=errcode, ) @@ -494,7 +495,7 @@ class RequestSendFailed(RuntimeError): def cs_error(msg: str, code: str = Codes.UNKNOWN, **kwargs): - """ Utility method for constructing an error response for client-server + """Utility method for constructing an error response for client-server interactions. Args: @@ -511,7 +512,7 @@ def cs_error(msg: str, code: str = Codes.UNKNOWN, **kwargs): class FederationError(RuntimeError): - """ This class is used to inform remote homeservers about erroneous + """This class is used to inform remote homeservers about erroneous PDUs they sent us. FATAL: The remote server could not interpret the source event.