server: Only pass `err` arg to `exports.exit()`

The `uncaughtException` event handlers are passed two arguments: error
and "origin". The `exports.exit()` argument doesn't expect a second
argument.
pull/4740/head
Richard Hansen 2021-02-09 00:04:20 -05:00 committed by John McLear
parent 5b327b63ac
commit 5999d8cd44
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ exports.start = async () => {
stats.gauge('memoryUsage', () => process.memoryUsage().rss); stats.gauge('memoryUsage', () => process.memoryUsage().rss);
stats.gauge('memoryUsageHeap', () => process.memoryUsage().heapUsed); stats.gauge('memoryUsageHeap', () => process.memoryUsage().heapUsed);
process.on('uncaughtException', exports.exit); process.on('uncaughtException', (err) => exports.exit(err));
// As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an // As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an
// unhandled rejection into an uncaught exception, which does cause Node.js to exit. // unhandled rejection into an uncaught exception, which does cause Node.js to exit.
process.on('unhandledRejection', (err) => { throw err; }); process.on('unhandledRejection', (err) => { throw err; });