mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 05:04:58 -04:00
Respond with proper error responses on unknown paths. (#14621)
Returns a proper 404 with an errcode of M_RECOGNIZED for unknown endpoints per MSC3743.
This commit is contained in:
parent
da77720752
commit
9d8a3234ba
9 changed files with 32 additions and 14 deletions
|
@ -300,10 +300,8 @@ class InteractiveAuthIncompleteError(Exception):
|
|||
class UnrecognizedRequestError(SynapseError):
|
||||
"""An error indicating we don't understand the request you're trying to make"""
|
||||
|
||||
def __init__(
|
||||
self, msg: str = "Unrecognized request", errcode: str = Codes.UNRECOGNIZED
|
||||
):
|
||||
super().__init__(400, msg, errcode)
|
||||
def __init__(self, msg: str = "Unrecognized request", code: int = 400):
|
||||
super().__init__(code, msg, Codes.UNRECOGNIZED)
|
||||
|
||||
|
||||
class NotFoundError(SynapseError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue