Skip to content

Commit

Permalink
Uniformize spam-checker API, part 5: expand other spam-checker callba…
Browse files Browse the repository at this point in the history
…cks to return `Tuple[Codes, dict]` (#13044)

Signed-off-by: David Teller <[email protected]>
Co-authored-by: Brendan Abolivier <[email protected]>
  • Loading branch information
Yoric and babolivier authored Jul 11, 2022
1 parent d736d5c commit 11f8114
Show file tree
Hide file tree
Showing 12 changed files with 426 additions and 60 deletions.
1 change: 1 addition & 0 deletions changelog.d/13044.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Support temporary experimental return values for spam checker module callbacks.
10 changes: 8 additions & 2 deletions synapse/api/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,14 @@ class AuthError(SynapseError):
other poorly-defined times.
"""

def __init__(self, code: int, msg: str, errcode: str = Codes.FORBIDDEN):
super().__init__(code, msg, errcode)
def __init__(
self,
code: int,
msg: str,
errcode: str = Codes.FORBIDDEN,
additional_fields: Optional[dict] = None,
):
super().__init__(code, msg, errcode, additional_fields)


class InvalidClientCredentialsError(SynapseError):
Expand Down
Loading

0 comments on commit 11f8114

Please sign in to comment.