summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/errors.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index 55181fe77e..01207282d6 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -87,13 +87,25 @@ class UnrecognizedRequestError(SynapseError):
     """An error indicating we don't understand the request you're trying to make"""
     def __init__(self, *args, **kwargs):
         if "errcode" not in kwargs:
-            kwargs["errcode"] = Codes.NOT_FOUND
+            kwargs["errcode"] = Codes.UNRECOGNIZED
         super(UnrecognizedRequestError, self).__init__(
             400,
             "Unrecognized request",
             **kwargs
         )
 
+
+class NotFoundError(SynapseError):
+    """An error indicating we can't find the thing you asked for"""
+    def __init__(self, *args, **kwargs):
+        if "errcode" not in kwargs:
+            kwargs["errcode"] = Codes.NOT_FOUND
+        super(UnrecognizedRequestError, self).__init__(
+            404,
+            "Not found",
+            **kwargs
+        )
+
 class AuthError(SynapseError):
     """An error raised when there was a problem authorising an event."""