fix: handle renderer crashes #115
This commit is contained in:
@@ -126,7 +126,7 @@ const initApp = async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Register process exit events
|
// Register process exit events
|
||||||
["SIGINT", "SIGTERM", "SIGQUIT", "exit"].forEach((signal) => {
|
["SIGINT", "SIGTERM", "SIGQUIT", "SIGTRAP", "exit"].forEach((signal) => {
|
||||||
process.on(signal, () => {
|
process.on(signal, () => {
|
||||||
process.exitCode = 0;
|
process.exitCode = 0;
|
||||||
APP.exiting = true;
|
APP.exiting = true;
|
||||||
@@ -230,6 +230,7 @@ const initLog = async () => {
|
|||||||
log.errorHandler.startCatching({
|
log.errorHandler.startCatching({
|
||||||
showDialog: false,
|
showDialog: false,
|
||||||
onError({ error, versions }) {
|
onError({ error, versions }) {
|
||||||
|
if (!error?.message?.includes("Object has been destroyed")) {
|
||||||
const build = { ...APP.build, ...versions };
|
const build = { ...APP.build, ...versions };
|
||||||
const whoopsie = "💥 Whoopsie!";
|
const whoopsie = "💥 Whoopsie!";
|
||||||
const section2 = `# Description\n- Hardware information?\n- How to reproduce?\n- Additional logs?\n`;
|
const section2 = `# Description\n- Hardware information?\n- How to reproduce?\n- Additional logs?\n`;
|
||||||
@@ -239,6 +240,7 @@ const initLog = async () => {
|
|||||||
const body = encodeURIComponent(`${section2}\n${section3}\n${section4}`);
|
const body = encodeURIComponent(`${section2}\n${section3}\n${section4}`);
|
||||||
console.error(`${whoopsie} -`, error, build);
|
console.error(`${whoopsie} -`, error, build);
|
||||||
console.info(`🪲 Report issue --> ${APP.issues}/new?title=${title}&body=${body}`);
|
console.info(`🪲 Report issue --> ${APP.issues}/new?title=${title}&body=${body}`);
|
||||||
|
}
|
||||||
app.quit();
|
app.quit();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+6
-3
@@ -818,7 +818,7 @@ const windowEvents = async () => {
|
|||||||
}
|
}
|
||||||
toggleNavigation("OFF");
|
toggleNavigation("OFF");
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1 * 1000);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1220,8 +1220,11 @@ const appEvents = async () => {
|
|||||||
|
|
||||||
// Handle crash events
|
// Handle crash events
|
||||||
app.on("render-process-gone", (e, wc, details) => {
|
app.on("render-process-gone", (e, wc, details) => {
|
||||||
const content = wc.getURL() || "Unknown";
|
const url = wc.getURL() || "Unknown";
|
||||||
console.error(`Render Process ${details.reason} (code ${details.exitCode}): ${content}`);
|
if (!url.startsWith("data:")) {
|
||||||
|
console.error(`Render Process ${details.reason} (code ${details.exitCode}): ${url}`);
|
||||||
|
}
|
||||||
|
reloadView();
|
||||||
});
|
});
|
||||||
app.on("child-process-gone", (e, details) => {
|
app.on("child-process-gone", (e, details) => {
|
||||||
const name = details.name || details.serviceName || "Unknown";
|
const name = details.name || details.serviceName || "Unknown";
|
||||||
|
|||||||
Reference in New Issue
Block a user