summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-10-12 11:48:02 +0100
committerDavid Baker <dave@matrix.org>2018-10-12 11:48:02 +0100
commitbddfad253a2ca8ea0645d10e89055c4ce2ff1c38 (patch)
tree28c76529b493d65c7379f4e0d95fe9b01fd61616 /synapse/rest
parentSplit /room_keys/version into 2 servlets (diff)
downloadsynapse-bddfad253a2ca8ea0645d10e89055c4ce2ff1c38.tar.xz
Don't mangle exceptions
Diffstat (limited to 'synapse/rest')
-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()