From dade385147e10e2dc15264992e028ed17d51a513 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 8 Feb 2019 10:43:17 +0000 Subject: [PATCH] Put error constant on the class --- src/client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index 314e31b26..a53a02eed 100644 --- a/src/client.js +++ b/src/client.js @@ -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( 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 // a different recovery key / the wrong passphrase. 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(