2018-10-27 01:10:46 +02:00

11 lines
190 B
JavaScript

const crash = reason => {
process.on(reason, err => {
console.error(reason, err.stack)
process.exit(-1)
})
}
crash('unhandledRejection')
crash('uncaughtError')
crash('warning')