summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2018-10-15 10:19:43 +0100
committerGitHub <noreply@github.com>2018-10-15 10:19:43 +0100
commit03c11032c346645ce5fc092f0755aaae39ff3bc7 (patch)
treee96e6846363f59c82513ffaf5f976c0b475f2d06 /synapse/api
parentMerge pull request #4033 from intelfx/py37-hotfixes (diff)
parentmissed one (diff)
downloadsynapse-03c11032c346645ce5fc092f0755aaae39ff3bc7.tar.xz
Merge pull request #4019 from matrix-org/dbkr/e2e_backups
E2E backups
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/errors.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/synapse/api/errors.py b/synapse/api/errors.py
index 2e7f98404d..48b903374d 100644
--- a/synapse/api/errors.py
+++ b/synapse/api/errors.py
@@ -59,6 +59,7 @@ class Codes(object):
     RESOURCE_LIMIT_EXCEEDED = "M_RESOURCE_LIMIT_EXCEEDED"
     UNSUPPORTED_ROOM_VERSION = "M_UNSUPPORTED_ROOM_VERSION"
     INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION"
+    WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
 
 
 class CodeMessageException(RuntimeError):
@@ -312,6 +313,20 @@ class LimitExceededError(SynapseError):
         )
 
 
+class RoomKeysVersionError(SynapseError):
+    """A client has tried to upload to a non-current version of the room_keys store
+    """
+    def __init__(self, current_version):
+        """
+        Args:
+            current_version (str): the current version of the store they should have used
+        """
+        super(RoomKeysVersionError, self).__init__(
+            403, "Wrong room_keys version", Codes.WRONG_ROOM_KEYS_VERSION
+        )
+        self.current_version = current_version
+
+
 class IncompatibleRoomVersionError(SynapseError):
     """A server is trying to join a room whose version it does not support."""