diff --git a/src/node/server.js b/src/node/server.js index 3e3b25d21..d14fca92d 100755 --- a/src/node/server.js +++ b/src/node/server.js @@ -77,6 +77,9 @@ exports.start = async () => { } process.on('uncaughtException', exports.exit); + // 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. + process.on('unhandledRejection', (err) => { throw err; }); /* * Connect graceful shutdown with sigint and uncaught exception