electron/spec/fixtures/api/unhandled-rejection-handled.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
288 B
JavaScript
Raw Normal View History

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();