Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Asynchronous Programming with JavaScript Asynchronous JavaScript with Callbacks Implement a Callback

Murilo de Melo
Murilo de Melo
13,962 Points

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.

Murilo de Melo
Murilo de Melo
13,962 Points

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?

Murilo de Melo
Murilo de Melo
13,962 Points

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