Skip to content

Commit

Permalink
fix: catch unhandled rejections
Browse files Browse the repository at this point in the history
This implements a listener for unhandledRejection errors that bubble up
all the way to the node process. Node 16 crashes on these exceptions,
which is a breaking change from Node 14.

This style supports Node 12+.
  • Loading branch information
varl committed Nov 18, 2021
1 parent cad5645 commit 50ca241
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/makeEntryPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const defaultConfig = require('./configDefaults.js')
const groupGlobalOptions = require('./groupGlobalOptions.js')
const reporter = require('./reporter.js')

process.on('unhandledRejection', (err) => {
throw err
})

module.exports = ({ builder, handler }) => {
const yargs = require('yargs') // singleton
// TODO: Show description
Expand Down

0 comments on commit 50ca241

Please sign in to comment.