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 Node.js Basics 2017 Handling Errors in Node Handling Status Code Errors

Leo Marco Corpuz
Leo Marco Corpuz
18,975 Points

Status code not working

Everything was working fine until I placed the status error code. I think I wrote the code exactly like the video. https://w.trhou.se/f5jb0r79rj

2 Answers

John Awoyele
John Awoyele
36,212 Points

On line 21, it seems you have a spelling error.Try changing

if(respnse.statusCode===200){

to

if(response.statusCode===200){

let me know if it doesn't work, or ? if it does

Leo Marco Corpuz
Leo Marco Corpuz
18,975 Points

Corrected that but still doesn't work. Thanks for your help!

John Awoyele
John Awoyele
36,212 Points

try using == instead of ===

Luka Belani
Luka Belani
10,673 Points

Same problem here...have you figured it out?