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