Repository URL to install this package:
|
Version:
1.2.7 ▾
|
// if (ENV_DEV) require('fliplog').trackConsole()
function registerCatch() {
process.on('unhandledRejection', (reason, promiseRejection) => {
const errorObj = {
rejection: 'Possibly Unhandled Rejection at: Promise ' + promiseRejection,
reason,
}
console.error({ errorObj })
throw promiseRejection
// process.exit(1)
})
process.on('unhandledException', exception => {
console.error(exception)
throw exception
// process.exit(1)
})
}
registerCatch()