Merge pull request #94 from overleaf/spd-unhandled-errors

Write to error log on unhandled rejection/exception
This commit is contained in:
Simon Detheridge
2020-02-27 10:37:31 +00:00
committed by GitHub
+9
View File
@@ -156,4 +156,13 @@ if (!module.parent) {
})
}
process
.on('unhandledRejection', (reason, p) => {
logger.err(reason, 'Unhandled Rejection at Promise', p)
})
.on('uncaughtException', err => {
logger.err(err, 'Uncaught Exception thrown')
process.exit(1)
})
module.exports = app