aboutsummaryrefslogtreecommitdiff
path: root/clientapi/jsonerror/jsonerror.go
diff options
context:
space:
mode:
Diffstat (limited to 'clientapi/jsonerror/jsonerror.go')
-rw-r--r--clientapi/jsonerror/jsonerror.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/clientapi/jsonerror/jsonerror.go b/clientapi/jsonerror/jsonerror.go
index be7d13a9..436e168a 100644
--- a/clientapi/jsonerror/jsonerror.go
+++ b/clientapi/jsonerror/jsonerror.go
@@ -171,6 +171,23 @@ func LeaveServerNoticeError() *MatrixError {
}
}
+// ErrRoomKeysVersion is an error returned by `PUT /room_keys/keys`
+type ErrRoomKeysVersion struct {
+ MatrixError
+ CurrentVersion string `json:"current_version"`
+}
+
+// WrongBackupVersionError is an error returned by `PUT /room_keys/keys`
+func WrongBackupVersionError(currentVersion string) *ErrRoomKeysVersion {
+ return &ErrRoomKeysVersion{
+ MatrixError: MatrixError{
+ ErrCode: "M_WRONG_ROOM_KEYS_VERSION",
+ Err: "Wrong backup version.",
+ },
+ CurrentVersion: currentVersion,
+ }
+}
+
type IncompatibleRoomVersionError struct {
RoomVersion string `json:"room_version"`
Error string `json:"error"`