Linked Questions
34 questions linked to/from Handling errors in Promise.all
1 vote
1 answer
2k views
Javascript Promise.all - how to handle all errors [duplicate]
How can I handle errors from other than first promise rejection? Example: Promise.all[p1, p2, p3].then(...) .catch((error) => { console.log(error) }) Order of rejection: p1 p2 p3 Is it possible ...
0 votes
1 answer
878 views
JS Promises.all() - how to prevent a 'catch' from stopping the promise chain? [duplicate]
Given an array of Promises, and a Promise.all() statement, if one of the promises fails, the entire chain stops (it doesn't wait for any subsequent Promises to fulfill) and Promise.all().catch() fires,...
0 votes
1 answer
1k views
Terminate multiple async functions in AWS lambda when error is thrown [duplicate]
I have a lambda which does multiple things in parallel (I call async functions and just wait for their Promise.all to be fulfilled before moving on). The problem: as soon as one of these tasks fails ...
1 vote
0 answers
127 views
Send simultaneous requests with async/await syntax and don't lost all results in case of one request failure [duplicate]
Two or more requests are sent simultaneously inside Promise.all. Then their responses are handled appropriately. But in case one of them is failed the rest of results is lost. async init function () ...
0 votes
0 answers
81 views
Return all resolved promises from set of promises? [duplicate]
We know that Promise.all returns a single Promise that resolves when all of the promises in the iterable argument have resolved or when the iterable argument contains no promises. It rejects with the ...
0 votes
0 answers
40 views
Handle a reject in promise.all() in javascript [duplicate]
The function makeRequest() returns a promise. Suppose 'secondPath' in promises returns a reject/error, i want to custom handle it for that case. but promises.all() is all or none. promises=["...
596 votes
20 answers
302k views
Wait until all promises complete even if some rejected
Let's say I have a set of Promises that are making network requests, of which one will fail: const arr = [ fetch('index.html'), fetch('http://does-not-exist') ] Promise.all(arr) .then(res => ...
58 votes
4 answers
16k views
Waiting for more than one concurrent await operation
How can I change the following code so that both async operations are triggered and given an opportunity to run concurrently? const value1 = await getValue1Async(); const value2 = await ...
6 votes
8 answers
12k views
Using Promise.all() to fetch a list of urls with await statements
tl;dr - if you have to filter the promises (say for errored ones) don't use async functions I'm trying to fetch a list of urls with async and parse them, the problem is that if there's an error with ...
4 votes
5 answers
11k views
Execute Promise.all in series
I have an array that contains an array of promises, and each inner array could have either 4k, 2k or 500 promises. In total there are around 60k promises and I may test it with other values as well. ...
8 votes
3 answers
7k views
Async/await not working AWS lambda, skipping everything after await
I'm trying to use AWS lambda to test a few API calls using axios, however I'm having some trouble. Every post I came across said the best way to handle promises in Lambda was to use async/await rather ...
2 votes
1 answer
7k views
Run a loop in parallel with Node
I have an array like this: var subscriptions = ['sub_1234', 'sub_5678', 'sub_8493']; In my real application the array usually has about 800 subscription ids. Currently I have a loop like this: var ...
2 votes
2 answers
8k views
sequelize - delete multiple rows and then bulk insert
I need to delete multiple rows from a table based on 3 fields. These fields are not the key columns. POST request sends all the rows. Sequelize does not support bulk delete based on columns. So I am ...
1 vote
2 answers
3k views
Promise.all(): Return a result after all Promises are resolved and/or rejected
I am having trouble with this code: // var env_array = ["env1", "env2", "env3", "env4"]; Promise.all(env_array.map(function(env) { return device_get_env(env).catch(function(err) { return err }); ...
-1 votes
1 answer
2k views
AWS S3 - Retreive multiple files and merge them after
I am trying to extract multiple files from AWS S3 bucket and willing to merge the response from all files after. E.g I have following files: my-bucket/mainfile1.json.gz my-bucket/mainfile2.json.gz my-...