Fixed: Parentheses do not match
This commit is contained in:
parent
101f8ba623
commit
fda9eb26eb
2 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
||||||
alert(responses[0].status); // 200
|
alert(responses[0].status); // 200
|
||||||
alert(responses[1].status); // 200
|
alert(responses[1].status); // 200
|
||||||
alert(responses[2]); // TypeError: failed to fetch (text may vary)
|
alert(responses[2]); // TypeError: failed to fetch (text may vary)
|
||||||
));
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -17,7 +17,7 @@ Promise.all(urls.map(url => fetch(url)))
|
||||||
for(let response of responses) {
|
for(let response of responses) {
|
||||||
alert(`${response.url}: ${response.status}`);
|
alert(`${response.url}: ${response.status}`);
|
||||||
}
|
}
|
||||||
));
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
The problem is that if any of requests fails, then `Promise.all` rejects with the error, and we loose results of all the other requests.
|
The problem is that if any of requests fails, then `Promise.all` rejects with the error, and we loose results of all the other requests.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue