mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -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);
|
fs.unlinkSync(this.userConfigPath);
|
||||||
return;
|
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);
|
logger.info(`config-handler: User configuration: `, this.userConfig);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user