mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +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", () => {
|
||||
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 New Issue
Block a user