summary refs log tree commit diff
path: root/synapse/api/errors.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2022-12-08 11:37:05 -0500
committerGitHub <noreply@github.com>2022-12-08 11:37:05 -0500
commit9d8a3234ba1d3ff831a7647f45c67946773d88a7 (patch)
tree256c2459353b973ccd217bf2282433932a500a97 /synapse/api/errors.py
parentCheck the stream position before checking if the cache is empty. (#14639) (diff)
downloadsynapse-9d8a3234ba1d3ff831a7647f45c67946773d88a7.tar.xz
Respond with proper error responses on unknown paths. (#14621)
Returns a proper 404 with an errcode of M_RECOGNIZED for
unknown endpoints per MSC3743.
Diffstat (limited to 'synapse/api/errors.py')
-rw-r--r--synapse/api/errors.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index e2cfcea0f2..76ef12ed3a 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -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):