Улучшение обработки ошибок
This commit is contained in:
@@ -146,7 +146,13 @@ class WebWorker {
|
|||||||
await fs.remove(dbPath);
|
await fs.remove(dbPath);
|
||||||
|
|
||||||
if (!await fs.pathExists(dbPath)) {
|
if (!await fs.pathExists(dbPath)) {
|
||||||
|
try {
|
||||||
await this.createDb(dbPath);
|
await this.createDb(dbPath);
|
||||||
|
} catch (e) {
|
||||||
|
//при ошибке создания БД удалим ее, чтобы не работать с поломанной базой при следующем запуске
|
||||||
|
await fs.remove(dbPath);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
utils.freeMemory();
|
utils.freeMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user