Улучшение обработки ошибок

This commit is contained in:
Book Pauk
2022-01-11 22:23:35 +07:00
parent d5404fd260
commit bcf3c2dab0

View File

@@ -585,10 +585,19 @@ class Reader {
//сохранение в serverStorage
if (value) {
await utils.sleep(500);
let timer = setTimeout(() => {
if (!this.offlineModeActive)
this.$root.notify.error('Таймаут соединения');
}, 10000);
try {
await this.$refs.serverStorage.saveRecent(value);
} catch (e) {
this.$root.notify.error(e.message);
if (!this.offlineModeActive)
this.$root.notify.error(e.message);
} finally {
clearTimeout(timer);
}
}
}