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 Asynchronous JavaScript with Callbacks Implement a Callback

One of the astronauts is not being retrieved. Console error: 404

One of the astronauts could not be retrieved, displaying the following in the console:

callbacks.js:18 GET https://en.wikipedia.org/api/rest_v1/page/summary/Anatoly%20Ivanishin 404
getJSON @ callbacks.js:18
(anonymous) @ callbacks.js:40
(anonymous) @ callbacks.js:38
xhr.onload @ callbacks.js:15
load (async)
getJSON @ callbacks.js:10
(anonymous) @ callbacks.js:37

2 Answers

One of the Russian astronauts' names was misspelled in one of the APIs the last time I looked.

Hi Mike. Tnx. I just found out the reason few seconds ago :) there's a generic solution in one the questions in the forum.

https://teamtreehouse.com/community/im-having-a-lot-of-problems-with-the-promises-call

That's unriliable for a program. Do you know a better solution?

I just found this one which seems great, simple and works (for now):

return Promise.allSettled(profiles);

Source: https://teamtreehouse.com/community/program-breaks-when-on-of-the-promises-are-rejected-namespelling-discrepancy-issue