Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 11f8114

Browse files
Yoricbabolivier
andauthored
Uniformize spam-checker API, part 5: expand other spam-checker callbacks to return Tuple[Codes, dict] (#13044)
Signed-off-by: David Teller <[email protected]> Co-authored-by: Brendan Abolivier <[email protected]>
1 parent d736d5c commit 11f8114

File tree

12 files changed

+426
-60
lines changed

12 files changed

+426
-60
lines changed

changelog.d/13044.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Support temporary experimental return values for spam checker module callbacks.

synapse/api/errors.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,14 @@ class AuthError(SynapseError):
297297
other poorly-defined times.
298298
"""
299299

300-
def __init__(self, code: int, msg: str, errcode: str = Codes.FORBIDDEN):
301-
super().__init__(code, msg, errcode)
300+
def __init__(
301+
self,
302+
code: int,
303+
msg: str,
304+
errcode: str = Codes.FORBIDDEN,
305+
additional_fields: Optional[dict] = None,
306+
):
307+
super().__init__(code, msg, errcode, additional_fields)
302308

303309

304310
class InvalidClientCredentialsError(SynapseError):

0 commit comments

Comments
 (0)