mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-24 08:33:36 +00:00
enterprise: Show error dialogbox on invalid JSON.
Fixes #1404. Co-authored-by: sammamama <samridhsame@gmail.com>
This commit is contained in:
committed by
Tim Abbott
parent
b42f9de27d
commit
e5680b12f4
@@ -3,6 +3,7 @@ import path from "node:path";
|
|||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
|
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
|
import {dialog} from "zulip:remote";
|
||||||
|
|
||||||
import {enterpriseConfigSchemata} from "./config-schemata.js";
|
import {enterpriseConfigSchemata} from "./config-schemata.js";
|
||||||
import Logger from "./logger-util.js";
|
import Logger from "./logger-util.js";
|
||||||
@@ -40,6 +41,10 @@ function reloadDatabase(): void {
|
|||||||
.partial()
|
.partial()
|
||||||
.parse(data);
|
.parse(data);
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
dialog.showErrorBox(
|
||||||
|
"Error loading global_config",
|
||||||
|
"We encountered an error while reading global_config.json, please make sure the file contains valid JSON.",
|
||||||
|
);
|
||||||
logger.log("Error while JSON parsing global_config.json: ");
|
logger.log("Error while JSON parsing global_config.json: ");
|
||||||
logger.log(error);
|
logger.log(error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user