Merge pull request #201 from aaronraimist/invalid-config

Add warning dialog when custom config.json is invalid
This commit is contained in:
Travis Ralston
2021-06-22 14:16:24 -06:00
committed by GitHub
+10
View File
@@ -207,6 +207,16 @@ async function setupGlobals() {
vectorConfig = Object.assign(vectorConfig, localConfig);
} catch (e) {
if (e instanceof SyntaxError) {
dialog.showMessageBox({
type: "error",
title: `Your ${vectorConfig.brand || 'Element'} is misconfigured`,
message: `Your custom ${vectorConfig.brand || 'Element'} configuration contains invalid JSON. ` +
`Please correct the problem and reopen ${vectorConfig.brand || 'Element'}.`,
detail: e.message || "",
});
}
// Could not load local config, this is expected in most cases.
}