You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/11-async/08-async-await/04-promise-all-failure/solution.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,32 @@ function customPromiseAllWait(promises) {
82
82
83
83
Now `await customPromiseAllWait(...)` will stall the execution until all queries are processed.
84
84
85
-
This is a more reliable approach.
85
+
This is a more reliable approach, as it guarantees a predictable execution flow.
86
86
87
-
Lastly, if we'd like to know about all the errors, e.g. for logging purposes, we can use `Promise.allSettled`.
87
+
Lastly, if we'd like to process all errors, we can use either use `Promise.allSettled` or write a wrapper around it to gathers all errors in a single [AggregateError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) object and rejects with it.
0 commit comments