I had posted a question earlier about Promise.all and d3.js v5, but another question come up regarding this piece of code:
var files = ["data1.json", "data2.json", "data3.json"];
var promises = [];
files.forEach(function(url) {
promises.push(d3.json(url))
});
Promise.all(promises).then(function(values) {
console.log(values)
});
If one of the URL's is invalid, the Promise.all doesn't return any of the results; in other words, all responses must be valid for the Promise.all to return the values. How can one get the other responses in the case of an error in one of the URL's?