summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/rest/client/v2_alpha/room_keys.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/rest/client/v2_alpha/room_keys.py b/synapse/rest/client/v2_alpha/room_keys.py
index aee6419179..8d006d819d 100644
--- a/synapse/rest/client/v2_alpha/room_keys.py
+++ b/synapse/rest/client/v2_alpha/room_keys.py
@@ -339,9 +339,7 @@ class RoomKeysVersionServlet(RestServlet):
             )
         except SynapseError as e:
             if e.code == 404:
-                e.errcode = Codes.NOT_FOUND
-                e.msg = "No backup found"
-                raise e
+                raise SynapseError(404, "No backup found", Codes.NOT_FOUND)
         defer.returnValue((200, info))
 
     @defer.inlineCallbacks
@@ -356,7 +354,7 @@ class RoomKeysVersionServlet(RestServlet):
         {}
         """
         if version is None:
-            raise SynapseError(400, "No version specified to delete")
+            raise SynapseError(400, "No version specified to delete", Codes.NOT_FOUND)
 
         requester = yield self.auth.get_user_by_req(request, allow_guest=False)
         user_id = requester.user.to_string()