LearnNewsExamplesServices
Frontmatter
id3737
titleStore loading catch error not working
stateClosed
labels
bugstale
assignees[]
createdAtJan 2, 2023, 2:10 AM
updatedAtSep 14, 2024, 4:26 AM
githubUrlhttps://github.com/neomjs/neo/issues/3737
authorDinkh
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtSep 14, 2024, 4:26 AM

Store loading catch error not working

Closed v8.1.0 bugstale
Dinkh
Dinkh commented on Jan 2, 2023, 2:10 AM

If the url for a store is not working (404) it is not getting into the promiseJson catch part but the then part. And there it crashes.

Neo.Xhr.promiseJson({
    url: params.url
}).catch(err => {
    console.log('Error for Neo.Xhr.request', err, me.id);
}).then(data => {
//==> here instead of above
    me.data = Array.isArray(data.json) ? data.json : data.json.data;
    // we do not need to fire a load event => onCollectionMutate()
});

To reproduce just set the store url to

    url: 'http://test.json'
Dinkh added the bug label on Jan 2, 2023, 2:10 AM