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 trialGi Devs
12,171 Pointsyou didnt call the console.error . . . but I did
I've been having problems with this challenge saying it's not passing when I think it should be, right now it's telling me the I haven't called the console.error method in the request error call back when I have. I've tried all sorts of things to try to make it pass but it just wont work.
here is my code
var http = require("http");
var request = http.get("http://teamtreehouse.com/chalkers.json", function(response){
console.log(response.statusCode);
});
request.on('error', function(error){
var msg = error.message;
console.error(msg);
});
2 Answers
jason chan
31,009 Pointsvar http = require("http");
var request = http.get("http://teamtreehouse.com/chalkers.json", function(response){
console.log(response.statusCode);
});
request.on('error', function(error){
console.error(error.message);
});
Gi Devs
12,171 PointsI did the challenge again and it worked fine for me. btw I did original have it like that I moved it around to try to fix the error. I still don't understand what was wrong but I managed to pass the challene
jason chan
31,009 PointsProbably it was cache error. I guess second time is a charm. ;)
Gi Devs
12,171 PointsI guess so. I did check your code and it worked so I'll give it a best answer