mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 00:38:28 +00:00
fix uncaught exception popup
This commit is contained in:
parent
8b25b51787
commit
5718bf8a7c
1 changed files with 22 additions and 0 deletions
|
|
@ -575,6 +575,28 @@ function makeAppMenu() {
|
|||
electron.app.on("before-quit", () => {
|
||||
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() {
|
||||
const startTs = Date.now();
|
||||
|
|
|
|||
Loading…
Reference in a new issue