Promise.all() is a very useful methods to use multiple async calls. It allows to pass as argument an array of async functions, and after all of them are succesfull, the then callback is executed.
The only problem with this approach is that, if one of the promises fail, then Promise.all() fails too, and the function is rejected. We don't necessarily want that. Maybe we want execute the then callback, even is some of the promises get rejected.
This can be achieved by managing the state of the single promises.
Catching the error
Let's suppose we want to call the then callback on Promise.all() even if getContacts() fails. In order to do that, we have to manage, when we read the response from the server, the error catch:
Even if we do nothing in the catch callback, the Promise is handled correctly, and the Promise.all() can continue its execution. In this case, doing a subscribe (this code is taken fron an Angular app) I also need to manage the possible fail of the subscribe, and I do that adding the arrow function at the end.




