LearnNewsExamplesServices
Frontmatter
id2015
titlefetch calls (apps, examples) => then, catch order
stateClosed
labels
enhancement
assigneestobiu
createdAtMay 10, 2021, 12:31 PM
updatedAtMay 10, 2021, 12:57 PM
githubUrlhttps://github.com/neomjs/neo/issues/2015
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMay 10, 2021, 12:57 PM

fetch calls (apps, examples) => then, catch order

Closed v8.1.0 enhancement
tobiu
tobiu commented on May 10, 2021, 12:31 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.

tobiu added the enhancement label on May 10, 2021, 12:31 PM
tobiu assigned to @tobiu on May 10, 2021, 12:31 PM
tobiu referenced in commit 38e5541 - "fetch calls (apps, examples) => then, catch order #2015" on May 10, 2021, 12:33 PM
tobiu closed this issue on May 10, 2021, 12:57 PM