It looks like as of node 15, unhandled promise rejections will terminate the Node process by default.
(node:28824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Associated commit to Node: nodejs/node#33021
What does this mean for neverthrow?
It means that the current fromPromise API will need to change:
const typicalPromise = functionThatReturnsPromiseThatMightThrow()
// ** BOOM **
// The line below never gets called in Node v15 because of the way that node treats unahndled rejections now
return ResultAsync.fromPromise(typicalPromise, mapPromiseRejection)
It looks like as of node 15, unhandled promise rejections will terminate the Node process by default.
Associated commit to Node: nodejs/node#33021
What does this mean for
neverthrow?It means that the current
fromPromiseAPI will need to change: