This course will be retired on September 1, 2022. We recommend "Node.js Basics" for up-to-date content.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Often a lot of the APIs give you an "error" event to listen to. In this video we'll handle this type of error event.
Update
Adding www
to the URL in the GET request on line 15 no longer results in an unhandled error event. Now it causes a SyntaxError: Unexpected end of JSON input
to be thrown instead. To generate the unhandled error event and practice the solution demonstrated in the video, you can substitute abc
for www
.
Documentation
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up