Handle render-process-gone
This commit is contained in:
parent
d87dceced9
commit
1b6cd3d16b
1 changed files with 13 additions and 0 deletions
|
@ -54,6 +54,19 @@ function _getError(reason: unknown): Error {
|
|||
}
|
||||
|
||||
export const addHandler = (): void => {
|
||||
app.on('render-process-gone', (_event, _webContents, details) => {
|
||||
const { reason, exitCode } = details;
|
||||
|
||||
if (reason === 'clean-exit') {
|
||||
return;
|
||||
}
|
||||
|
||||
handleError(
|
||||
'Render process is gone',
|
||||
new Error(`Reason: ${reason}, Exit Code: ${exitCode}`)
|
||||
);
|
||||
});
|
||||
|
||||
process.on('uncaughtException', (reason: unknown) => {
|
||||
handleError('Unhandled Error', _getError(reason));
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue