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

This commit is contained in:
Book Pauk
2022-10-21 13:50:55 +07:00
parent 294fb35f4d
commit e865070f23

View File

@@ -83,6 +83,7 @@ class ConfigManager {
} }
async load() { async load() {
try {
if (!this.inited) if (!this.inited)
throw new Error('not inited'); throw new Error('not inited');
@@ -101,6 +102,9 @@ class ConfigManager {
} else { } else {
await this.save(); await this.save();
} }
} catch(e) {
throw new Error(`Error while loading "${this.userConfigFile}": ${e.message}`);
}
} }
async save() { async save() {