Linked Questions

1 vote
1 answer
2k views

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 ...
Tomasz Niedziela-Brach's user avatar
0 votes
1 answer
878 views

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,...
Ryan Griggs's user avatar
  • 2,808
0 votes
1 answer
1k views

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 ...
Dean's user avatar
  • 7,034
1 vote
0 answers
127 views

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 () ...
Carter's user avatar
  • 10.9k
0 votes
0 answers
81 views

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 ...
Ksoze's user avatar
  • 47
0 votes
0 answers
40 views

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=["...
AB B's user avatar
  • 1
596 votes
20 answers
302k views

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 => ...
Nathan Hagen's user avatar
  • 12.8k
58 votes
4 answers
16k views

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 ...
Ben Aston's user avatar
  • 56k
6 votes
8 answers
12k views

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 ...
S. Schenk's user avatar
  • 2,170
4 votes
5 answers
11k views

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. ...
Rodrigo Zurek's user avatar
8 votes
3 answers
7k views

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 ...
Sal's user avatar
  • 1,747
2 votes
1 answer
7k views

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 ...
Jordash's user avatar
  • 3,123
2 votes
2 answers
8k views

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 ...
pooja kosala's user avatar
1 vote
2 answers
3k views

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 }); ...
sevenfourk's user avatar
-1 votes
1 answer
2k views

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-...
StormTrooper's user avatar
  • 1,783

15 30 50 per page