Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Asynchronous Programming with JavaScript Understanding Promises Using Fetch

Amy Preci
Amy Preci
6,247 Points

Why Oh Why do my profiles render when I use the fetch method, and did not with the previous getJSON function?

So now everything renders, and the promises fulfilled, even though there were 404 errors. How come?

If you could post the code or a snapshot it would be easier for someone to help provide an explanation. I haven't made it to the fetch portion of the that course but I do remember that there was some issue with the name values in the JSON not matching the wikipedia articles due to differences in spelling which could be the issue.

1 Answer

Steven Parker
Steven Parker
231,198 Points

If this is related to your previous questions about name mismatches, I just posted an answer over there. But I'm not sure how just changing the method would make a difference in the retrievals succeeding, so we might still need to look at the actual code.

Hey Steven Parker - it should still render the profiles that successfully connected with the wiki api, right? as long as there wasn't an error in the actual code or something in the catch statement to detect a 404 to stop the code from running, everything should still run as expected? im still learning async functions so I'm just checking to see if I correctly understand.