mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-25 16:31:27 -06:00
SDA-4501 (Initialize new data if the user config is unable to parse) (#2136)
* SDA-4501 - Initialize new user config if data is corrupted * SDA-4501 - Delete file before initializing
This commit is contained in:
parent
8c066b963f
commit
020cd05eab
@ -635,7 +635,17 @@ class Config {
|
||||
fs.unlinkSync(this.userConfigPath);
|
||||
return;
|
||||
}
|
||||
this.userConfig = this.parseConfigData(userConfig);
|
||||
try {
|
||||
this.userConfig = this.parseConfigData(userConfig);
|
||||
} catch (e) {
|
||||
logger.info(
|
||||
`config-handler: User config file is corrupted. Initializing new file`,
|
||||
e,
|
||||
);
|
||||
fs.unlinkSync(this.userConfigPath);
|
||||
this.userConfig = {};
|
||||
await this.initializeUserConfig();
|
||||
}
|
||||
}
|
||||
logger.info(`config-handler: User configuration: `, this.userConfig);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user