1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Better error handling during sync setup

This commit is contained in:
Laurent Cozic
2017-07-06 23:15:31 +01:00
parent 8ee0c38f86
commit 8751aa1a34
10 changed files with 81 additions and 8285 deletions

View File

@ -69,7 +69,11 @@ class Setting extends BaseModel {
}
static value(key) {
if (key in this.constants_) return this.constants_[key];
if (key in this.constants_) {
let output = this.constants_[key];
if (output == 'SET_ME') throw new Error('Setting constant has not been set: ' + key);
return output;
}
if (!this.cache_) throw new Error('Settings have not been initialized!');
@ -153,6 +157,7 @@ Setting.defaults_ = {
Setting.constants_ = {
'appName': 'joplin',
'appId': 'SET_ME', // Each app should set this identifier
'appType': 'SET_ME', // 'cli' or 'mobile'
'resourceDir': '',
'profileDir': '',
'tempDir': '',