Await several promises without failing on the first

const settled = await Promise.all(
  tasks.map(t => t.then(
    value => ({ ok: true, value }),
    error => ({ ok: false, error })
  ))
);

const failures = settled.filter(r => !r.ok);