mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
feat(startup): display migration errors using system modal
This commit is contained in:
@@ -10,6 +10,8 @@ import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { dirname, join } from "path";
|
||||
import type NoteMeta from "./meta/note_meta.js";
|
||||
import log from "./log.js";
|
||||
import { t } from "i18next";
|
||||
|
||||
const randtoken = generator({ source: "crypto" });
|
||||
|
||||
@@ -105,10 +107,13 @@ export function escapeRegExp(str: string) {
|
||||
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
|
||||
}
|
||||
|
||||
export async function crash() {
|
||||
export async function crash(message: string) {
|
||||
if (isElectron) {
|
||||
(await import("electron")).app.exit(1);
|
||||
const electron = await import("electron");
|
||||
electron.dialog.showErrorBox(t("modals.error_title"), message);
|
||||
electron.app.exit(1);
|
||||
} else {
|
||||
log.error(message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user