summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/client/v2_alpha/room_keys.py14
-rw-r--r--synapse/storage/schema/delta/51/e2e_room_keys.sql (renamed from synapse/storage/schema/delta/46/e2e_room_keys.sql)0
2 files changed, 10 insertions, 4 deletions
diff --git a/synapse/rest/client/v2_alpha/room_keys.py b/synapse/rest/client/v2_alpha/room_keys.py
index 1ed18e986f..ea114bc8b4 100644
--- a/synapse/rest/client/v2_alpha/room_keys.py
+++ b/synapse/rest/client/v2_alpha/room_keys.py
@@ -17,7 +17,7 @@ import logging
 
 from twisted.internet import defer
 
-from synapse.api.errors import SynapseError
+from synapse.api.errors import SynapseError, Codes
 from synapse.http.servlet import (
     RestServlet,
     parse_json_object_from_request,
@@ -324,9 +324,15 @@ class RoomKeysVersionServlet(RestServlet):
         requester = yield self.auth.get_user_by_req(request, allow_guest=False)
         user_id = requester.user.to_string()
 
-        info = yield self.e2e_room_keys_handler.get_version_info(
-            user_id, version
-        )
+        try:
+            info = yield self.e2e_room_keys_handler.get_version_info(
+                user_id, version
+            )
+        except SynapseError as e:
+            if e.code == 404:
+                e.errcode = Codes.NOT_FOUND
+                e.msg = "No backup found"
+                raise e
         defer.returnValue((200, info))
 
     @defer.inlineCallbacks
diff --git a/synapse/storage/schema/delta/46/e2e_room_keys.sql b/synapse/storage/schema/delta/51/e2e_room_keys.sql
index 4531fd56ee..4531fd56ee 100644
--- a/synapse/storage/schema/delta/46/e2e_room_keys.sql
+++ b/synapse/storage/schema/delta/51/e2e_room_keys.sql