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 trialzachstockmal
6,413 PointsWhy is my console printing "There was an error getting the profile for chalker123. ([object Object])"
Here is my workspace:
There must be some line of code I missed somewhere or maybe a typo but I'm not seeing it right now. If anyone else does that would be so wonderful!
1 Answer
Seth Reece
32,867 PointsThere is no chalkers123 profile. His profile is just chalkers.
zachstockmal
6,413 Pointszachstockmal
6,413 PointsTrue, but in the video it came up with (Not found) in the message and I got ([object Object]). I'm wondering why that error message didn't go through. I was just trying to also get that error message.
Seth Reece
32,867 PointsSeth Reece
32,867 PointsYou need to pass in response.statusCode to http.STATUS_CODES.
From theAPI docs,
"http.STATUS_CODES Object A collection of all the standard HTTP response status codes, and the short description of each. For example, http.STATUS_CODES[404] === 'Not Found'."
So you want:
http.STATUS_CODES[response.statusCode]
and you are good to go.
zachstockmal
6,413 Pointszachstockmal
6,413 PointsAwesome that worked! Thank you.