Created
December 10, 2021 08:15
-
-
Save AleksejDix/81a7dd962f6ca4ae3628068f0ea32f28 to your computer and use it in GitHub Desktop.
Handling Promise.all errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const results = await Promise.all(promises.map(p => p.catch(e => e))); | |
const validResults = results.filter(result => !(result instanceof Error)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also there is new way of doing this