Q:

Anti-Pattern to aggregate errors and pass to promise resolve js?

I'm processing a list in a loop that's run async returning a promise and I do not want to exit processing on exception, so I aggregate them and pass them to the resolve callback in an outer finally block.
I'll like to know if this is an anti-pattern and if so, please provide a pointer on how to do correctly.
Thanks.
Example
async doSomething(list) {
let errorCount = 0
let errors = []
return new Promise(async (resolve, reject) => {
  try {
    list.forEach(async (item) => {
      try {
        actionThatThrows(item)
      } catch (e) {
        errorCount++
        errors[errorCount] = e
      }
    })
  } catch (e) {
    errorCount++
    errors[errorCount] = e
  } finally {
    if (errorCount > 0) {
      resolve(errors)
    } else {
      resolve()
    }
  }
})

}

A:

Yes, this code employs several antipatterns:

Never pass an async function to a Promise constructor
Never use the Promise constructor when you already have promises around
forEach does not work with async functions

I do not want to exit processing on exception but aggregate them

You might want to have a look at Wait until all ES6 promises complete, even rejected promises for that.
But you can do it without those as well, assuming you want sequential iteration:
async function doSomething(list) {
    const errors = [];
    for (let item of list) {
        try {
            await actionThatThrows(item);
        } catch (e) {
            errors.push(e);
        }
    }
    if (errors.length)
        return errors;
    else
        return …;
}

A:

The errors are the result of your asynchronous computation so it globally looks legit.
Assuming that actionThatThrows returns a promise (it's unclear in your question and code), it looks like it could be written like this:
function doSomething(list) {
    let errors = []
    return Promise.all(list.map(
        item => actionThatThrows(item).catch(e => {
            errors.push(e);
        })
    )).then(()=>{
        return errors.length ? errors : undefined;
    });
}

