fix: don't double-log unhandled rejections (#37464)

This commit is contained in:
Shelley Vohr
2023-03-06 11:04:43 +01:00
committed by GitHub
parent 17ccb3c6ec
commit 829fb4f586
5 changed files with 56 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
const { app } = require('electron');
const handleUnhandledRejection = (reason) => {
console.error(`Unhandled Rejection: ${reason.stack}`);
app.quit();
};
const main = async () => {
process.on('unhandledRejection', handleUnhandledRejection);
throw new Error('oops');
};
main();

View File

@@ -0,0 +1,5 @@
const main = async () => {
throw new Error('oops');
};
main();