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
parent
5b327b63ac
commit
5999d8cd44
|
@ -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; });
|
||||||
|
|
Loading…
Reference in New Issue