1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Testing and better handling of E2EE initialisation

This commit is contained in:
Laurent Cozic
2017-12-17 20:51:45 +01:00
parent f5d26e0d81
commit 4c0b472f67
7 changed files with 136 additions and 13 deletions

View File

@ -82,7 +82,11 @@ class EncryptionService {
}
activeMasterKeyId() {
if (!this.activeMasterKeyId_) throw new Error('No master key is defined as active');
if (!this.activeMasterKeyId_) {
const error = new Error('No master key is defined as active. Check this: Either one or more master keys exist but no password was provided for any of them. Or no master key exist. Or master keys and password exist, but none was set as active.');
error.code = 'noActiveMasterKey';
throw error;
}
return this.activeMasterKeyId_;
}