From ec5465f2d2c2459ae71804f55a4985ca81c6c1a0 Mon Sep 17 00:00:00 2001 From: monoid Date: Tue, 12 Jan 2021 16:10:05 +0900 Subject: [PATCH] chg show error messagebox --- app.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app.ts b/app.ts index 88cb337..b1a9d4d 100644 --- a/app.ts +++ b/app.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, session } from "electron"; +import { app, BrowserWindow, session, dialog } from "electron"; import { get_setting } from "./src/setting"; import { create_server, start_server } from "./src/server"; import { getAdminAccessTokenValue,getAdminRefreshTokenValue, accessTokenName, refreshTokenName } from "./src/login"; @@ -39,10 +39,18 @@ if (!setting.cli) { } catch(e){ if(e instanceof Error){ - await wnd.webContents.executeJavaScript(`document.querySelector("body").innerHTML="

${e.message}

"`) + await dialog.showMessageBox({ + type: "error", + title:"error!", + message:e.message, + }); } else{ - await wnd.webContents.executeJavaScript(`document.querySelector("body").innerHTML="

${e}

"`) + await dialog.showMessageBox({ + type: "error", + title:"error!", + message:String(e), + }); } } wnd.on("closed", () => {