Skip to content

Instantly share code, notes, and snippets.

@clohr
Created February 28, 2019 20:37
Show Gist options
  • Save clohr/d1a36f62d2849ea2c55e92c278b0ff92 to your computer and use it in GitHub Desktop.
Save clohr/d1a36f62d2849ea2c55e92c278b0ff92 to your computer and use it in GitHub Desktop.
Guarantee that all responses are returned from Promise.all regardless of error status
const queues = [...LIST_OF_PROMISES]
// this maps over all the queued responses to guarantee that all responses are returned regardless of error status
return Promise.all(queues.map(q => {
return q.catch(err => ({status: err.status}))
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment