Frontmatter
| id | 2015 |
| title | fetch calls (apps, examples) => then, catch order |
| state | Closed |
| labels | enhancement |
| assignees | tobiu |
| createdAt | May 10, 2021, 12:31 PM |
| updatedAt | May 10, 2021, 12:57 PM |
| githubUrl | https://github.com/neomjs/neo/issues/2015 |
| author | tobiu |
| commentsCount | 0 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | May 10, 2021, 12:57 PM |
old:
fetch(url) .then(response => response.json()) .then(data => me.addStoreItems(data)) .catch(err => console.log('Can’t access ' + url, err));new:
fetch(url) .then(response => response.json()) .catch(err => console.log('Can’t access ' + url, err)) .then(data => me.addStoreItems(data));we only want the catch error for failed requests and not for errors inside the callback.