Улучшение обработки ошибок
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user