Added catch statements

This commit is contained in:
Kevin Röbert
2020-02-20 14:12:06 +01:00
parent a44e13645c
commit f7949e89f6
8 changed files with 41 additions and 45 deletions

View File

@@ -75,7 +75,7 @@ function saveOnDisk(keys) {
});
console.log(translate('core_save_on_disk'));
browser.storage.local.set(json);
browser.storage.local.set(json).catch(handleError);
}
/**
@@ -114,7 +114,7 @@ function genesis() {
// Start history listener
historyListenerStart();
}, error);
}, handleError);
}
/**
@@ -164,14 +164,6 @@ function setData(key, value) {
}
}
/**
* Write error on console.
*/
function error(e) {
console.log(translate('core_error'));
console.error(e);
}
/**
* Set default values, if the storage is empty.
* @param {Object} items