You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log(`Error with the request! ${response.status}`);
return;
}
returnresponse.json();
};
exportconstgetData=url=>{
returnfetch(`${url}?access_token=${accessToken}`)
.then(checkResponse)
.catch(err=>{
thrownewError(`fetch getUserData failed ${err}`);
});
};
The fetch util currently swallows non-200 responses silently (returning undefined) and catches then rethrows fetch errors. I think it would be a better example if we changed it to something like this:
I forgot to update the solution (I only changed the readme) which meant a bunch of people ended up using the old version in their projects. Reminder to myself to update the solution too at some point
react-dynamic-data-workshop/solution/src/utils/data_helpers.js
Lines 4 to 18 in fd8edc8
The fetch util currently swallows non-200 responses silently (returning
undefined
) and catches then rethrows fetch errors. I think it would be a better example if we changed it to something like this:The text was updated successfully, but these errors were encountered: