mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-04 18:59:08 +01:00
fix uncaught exception popup
This commit is contained in:
parent
8b25b51787
commit
5718bf8a7c
@ -575,6 +575,28 @@ function makeAppMenu() {
|
|||||||
electron.app.on("before-quit", () => {
|
electron.app.on("before-quit", () => {
|
||||||
globalIsQuitting = true;
|
globalIsQuitting = true;
|
||||||
});
|
});
|
||||||
|
process.on("SIGINT", () => {
|
||||||
|
console.log("Caught SIGINT, shutting down");
|
||||||
|
electron.app.quit();
|
||||||
|
});
|
||||||
|
process.on("SIGHUP", () => {
|
||||||
|
console.log("Caught SIGHUP, shutting down");
|
||||||
|
electron.app.quit();
|
||||||
|
});
|
||||||
|
process.on("SIGTERM", () => {
|
||||||
|
console.log("Caught SIGTERM, shutting down");
|
||||||
|
electron.app.quit();
|
||||||
|
});
|
||||||
|
let caughtException = false;
|
||||||
|
process.on("uncaughtException", (error) => {
|
||||||
|
if (caughtException) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
logger.error("Uncaught Exception, shutting down: ", error);
|
||||||
|
caughtException = true;
|
||||||
|
// Optionally, handle cleanup or exit the app
|
||||||
|
electron.app.quit();
|
||||||
|
});
|
||||||
|
|
||||||
async function appMain() {
|
async function appMain() {
|
||||||
const startTs = Date.now();
|
const startTs = Date.now();
|
||||||
|
Loading…
Reference in New Issue
Block a user