Skip to content

Commit

Permalink
Handle render-process-gone
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny-signal committed Jun 30, 2022
1 parent d87dcec commit 1b6cd3d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/global_errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand Down

0 comments on commit 1b6cd3d

Please sign in to comment.