Skip to content

Commit e5680b1

Browse files
shubham-padiasammamama
authored andcommitted
enterprise: Show error dialogbox on invalid JSON.
Fixes #1404. Co-authored-by: sammamama <[email protected]>
1 parent b42f9de commit e5680b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/common/enterprise-util.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from "node:path";
33
import process from "node:process";
44

55
import {z} from "zod";
6+
import {dialog} from "zulip:remote";
67

78
import {enterpriseConfigSchemata} from "./config-schemata.js";
89
import Logger from "./logger-util.js";
@@ -40,6 +41,10 @@ function reloadDatabase(): void {
4041
.partial()
4142
.parse(data);
4243
} catch (error: unknown) {
44+
dialog.showErrorBox(
45+
"Error loading global_config",
46+
"We encountered an error while reading global_config.json, please make sure the file contains valid JSON.",
47+
);
4348
logger.log("Error while JSON parsing global_config.json: ");
4449
logger.log(error);
4550
}

0 commit comments

Comments
 (0)