1
0
mirror of synced 2025-12-22 11:26:57 -05:00
Files
docs/lib/handle-exceptions.js
Kevin Heis 8a56437c93 Pretty format (#20352)
* Update prettier flow to include JS

* Run prettier

* ...run prettier
2021-07-14 14:35:01 -07:00

19 lines
486 B
JavaScript

import FailBot from './failbot.js'
process.on('uncaughtException', async (err) => {
if (err.code === 'MODULE_NOT_FOUND') {
console.error('\n\n🔥 Uh oh! It looks you are missing a required npm module.')
console.error(
'Please run `npm install` to make sure you have all the required dependencies.\n\n'
)
}
console.error(err)
await FailBot.report(err)
})
process.on('unhandledRejection', async (err) => {
console.error(err)
await FailBot.report(err)
})