Looking at previous answers, an appropriate way to handle errors inside a Promise.all is by using something like:
Promise.all(
promises.map(p => p.catch(error => null))
)
In my code I want to pass an async func inside the mapping of the promise and be able to run a catch should that promise fail, without it killing the entire chain.
My code:
const handler = async (item) => {
const result = await Promise()
return result
}
const items = [1,2,3]
const results = await Promise.all(items.map(handler))
How would I be able to run the handler func inside the Promise.all while still catching for errors and keeping the chain alive?