File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1+ import { dialog } from "electron/main" ;
12import fs from "node:fs" ;
23import path from "node:path" ;
34import process from "node:process" ;
@@ -6,6 +7,7 @@ import {z} from "zod";
67
78import { enterpriseConfigSchemata } from "./config-schemata.js" ;
89import Logger from "./logger-util.js" ;
10+ import * as Messages from "./messages.js" ;
911
1012type EnterpriseConfig = {
1113 [ Key in keyof typeof enterpriseConfigSchemata ] : z . output <
@@ -40,6 +42,8 @@ function reloadDatabase(): void {
4042 . partial ( )
4143 . parse ( data ) ;
4244 } catch ( error : unknown ) {
45+ const { title, content} = Messages . enterpriseInvalidJson ( enterpriseFile ) ;
46+ dialog . showErrorBox ( title , content ) ;
4347 logger . log ( "Error while JSON parsing global_config.json: " ) ;
4448 logger . log ( error ) ;
4549 }
Original file line number Diff line number Diff line change @@ -36,3 +36,12 @@ export function orgRemovalError(url: string): DialogBoxError {
3636 content : "Please contact your system administrator." ,
3737 } ;
3838}
39+
40+ export function enterpriseInvalidJson (
41+ pathToConfigFile : string ,
42+ ) : DialogBoxError {
43+ return {
44+ title : "Invalid JSON" ,
45+ content : `Correct the invalid JSON format in global_config.json.\nIt can be found in:\n${ pathToConfigFile } ` ,
46+ } ;
47+ }
You can’t perform that action at this time.
0 commit comments