Since Node.js 12.9.0, there is a fault-tolerant version of Promise.all() available out of the box: Promise.allSettled(). Browser support seems also quite good, but not 100 %.
Promise.allSettled is another way to handle multiple promises. The difference is that Promise.all rejects as soon one rejects, Promise.allSettled() returns a promise that resolves after all have rejected or resolved. This means it is more fault-tolerant, you can achieve the same with adding a catch handler to the promise.all, see example in article. I think I will add an article about the difference Promise.all and Promise.allSettled. Thanks for the constructive input.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Since Node.js 12.9.0, there is a fault-tolerant version of
Promise.all()
available out of the box: Promise.allSettled(). Browser support seems also quite good, but not 100 %.Promise.allSettled is another way to handle multiple promises. The difference is that Promise.all rejects as soon one rejects, Promise.allSettled() returns a promise that resolves after all have rejected or resolved. This means it is more fault-tolerant, you can achieve the same with adding a catch handler to the promise.all, see example in article. I think I will add an article about the difference Promise.all and Promise.allSettled. Thanks for the constructive input.