1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Put error constant on the class

This commit is contained in:
David Baker
2019-02-08 10:43:17 +00:00
parent 1a425af3f2
commit dade385147

View File

@@ -1093,7 +1093,7 @@ MatrixClient.prototype.isValidRecoveryKey = function(recoveryKey) {
} }
}; };
MatrixClient.prototype.RESTORE_BACKUP_ERROR_BAD_KEY = 'RESTORE_BACKUP_ERROR_BAD_KEY'; MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY = 'RESTORE_BACKUP_ERROR_BAD_KEY';
MatrixClient.prototype.restoreKeyBackupWithPassword = async function( MatrixClient.prototype.restoreKeyBackupWithPassword = async function(
password, targetRoomId, targetSessionId, backupInfo, password, targetRoomId, targetSessionId, backupInfo,
@@ -1139,7 +1139,7 @@ MatrixClient.prototype._restoreKeyBackup = function(
// doesn't match the one in the auth_data, the user has enetered // doesn't match the one in the auth_data, the user has enetered
// a different recovery key / the wrong passphrase. // a different recovery key / the wrong passphrase.
if (backupPubKey !== backupInfo.auth_data.public_key) { if (backupPubKey !== backupInfo.auth_data.public_key) {
return Promise.reject({errcode: this.RESTORE_BACKUP_ERROR_BAD_KEY}); return Promise.reject({errcode: MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY});
} }
return this._http.authedRequest( return this._http.authedRequest(