Улучшение обработки ошибок
This commit is contained in:
@@ -585,10 +585,19 @@ class Reader {
|
|||||||
//сохранение в serverStorage
|
//сохранение в serverStorage
|
||||||
if (value) {
|
if (value) {
|
||||||
await utils.sleep(500);
|
await utils.sleep(500);
|
||||||
|
|
||||||
|
let timer = setTimeout(() => {
|
||||||
|
if (!this.offlineModeActive)
|
||||||
|
this.$root.notify.error('Таймаут соединения');
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$refs.serverStorage.saveRecent(value);
|
await this.$refs.serverStorage.saveRecent(value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (!this.offlineModeActive)
|
||||||
this.$root.notify.error(e.message);
|
this.$root.notify.error(e.message);
|
||||||
|
} finally {
|
||||||
|
clearTimeout(timer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user