Exception handling for storageManager setItem, sessionHistory save to disk notice

This commit is contained in:
Mo Bitar
2019-04-02 09:26:44 -05:00
parent 5ad3904cf5
commit 301514c9a4
3 changed files with 13 additions and 3 deletions

View File

@@ -107,7 +107,12 @@ class StorageManager extends SFStorageManager {
async setItem(key, value, vaultKey) {
var storage = this.getVault(vaultKey);
storage.setItem(key, value);
try {
storage.setItem(key, value);
} catch (e) {
console.error("Exception while trying to setItem in StorageManager:", e);
alert("The application's local storage is out of space. If you have Session History save-to-disk enabled, please disable it, and try again.");
}
if(vaultKey === StorageManager.FixedEncrypted || (!vaultKey && this.itemsStorageMode === StorageManager.FixedEncrypted)) {
this.writeEncryptedStorageToDisk();