This makes it possible to catch exceptions in processFiles in
cli.js. Without this, node raises an error when promise throws an
exception:
node:internal/process/promises:245
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "[object Object]".] {
code: 'ERR_UNHANDLED_REJECTION'
}
This makes it possible to catch exceptions in
processFiles
incli.js
. Without this, node raises an error when promise throws an exception: