Skip to content

Commit

Permalink
Add error handling to initial config load
Browse files Browse the repository at this point in the history
  • Loading branch information
confused-Techie committed Oct 5, 2023
1 parent 5f3e40a commit f1f4dc8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main-process/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ function getConfig() {
let configFilePath = getConfigFilePath();

if (configFilePath) {
const configFileData = CSON.readFileSync(configFilePath);
config.resetUserSettings(configFileData);
CSON.readFile(configFilePath, (error, data) => {
// Duplicated from `./src/config-file.js`.reload()
if (error) {
console.log(error.message);
} else {
config.resetUserSettings(configFileData);
}
});
}

return config;
Expand Down

0 comments on commit f1f4dc8

Please sign in to comment.