Skip to main content

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

Join the Treehouse affiliate program and earn 25% recurring commission! 🤑

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Daron Anderson
    Daron Anderson
    2,567 Points

    A suggestion before the try block.

    Posted July 24, 2020 6:34am by Daron Anderson
    Daron Anderson
    2,567 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    0 Answers

  • Charlie Prator
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Charlie Prator
    Front End Web Development Techdegree Graduate 19,854 Points

    Getting the error "SyntaxError: Unexpected end of JSON input"--instead of "Unhandled 'error' event"

    Posted April 13, 2020 11:21pm by Charlie Prator
    .a{fill-rule:evenodd;}techdegree seal-36
    Charlie Prator
    Front End Web Development Techdegree Graduate 19,854 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    5 Answers

  • tapio
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    tapio
    Full Stack JavaScript Techdegree Graduate 25,832 Points

    I could not get the catch method to work properly.

    Posted April 4, 2020 10:10am by tapio
    .a{fill-rule:evenodd;}techdegree seal-36
    tapio
    Full Stack JavaScript Techdegree Graduate 25,832 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • Rishi B
    Rishi B
    13,866 Points

    what is this error? SyntaxError: Unexpected end of JSON input

    Posted April 1, 2020 12:17pm by Rishi B
    Rishi B
    13,866 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    3 Answers

  • Katie Shook
    Katie Shook
    12,326 Points

    I'm not getting an error but rather ${error.message} is being interpolated.

    Posted December 18, 2019 8:35pm by Katie Shook
    Katie Shook
    12,326 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    2 Answers

  • mk37
    mk37
    10,271 Points

    Would it not be better to use promise object instead of try...catch?

    Posted December 17, 2019 9:30pm by mk37
    mk37
    10,271 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • Jasmine Taylor
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Jasmine Taylor
    Full Stack JavaScript Techdegree Graduate 16,887 Points

    Uncaught ReferenceError: require is not defined

    Posted July 26, 2019 5:55pm by Jasmine Taylor
    .a{fill-rule:evenodd;}techdegree seal-36
    Jasmine Taylor
    Full Stack JavaScript Techdegree Graduate 16,887 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • mouhamadoudiouf
    mouhamadoudiouf
    14,915 Points

    Need help on my Node.JS file

    Posted March 28, 2019 10:39pm by mouhamadoudiouf
    mouhamadoudiouf
    14,915 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    4 Answers

  • ada ada
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    ada ada
    Front End Web Development Techdegree Student 192 Points

    When to use try catch and when to use request.on(error)?

    Posted March 16, 2019 7:44pm by ada ada
    .a{fill-rule:evenodd;}techdegree
    ada ada
    Front End Web Development Techdegree Student 192 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    2 Answers

  • Forrest Olson
    Forrest Olson
    16,661 Points

    Error: "events.js:141 throw er; // Unhandled 'error' event"

    Posted March 14, 2019 12:18am by Forrest Olson
    Forrest Olson
    16,661 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • Peter Retvari
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points

    request.on vs. try--catch

    Posted October 27, 2018 4:43pm by Peter Retvari
    .a{fill-rule:evenodd;}techdegree
    Peter Retvari
    Full Stack JavaScript Techdegree Student 8,392 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • lukej
    lukej
    34,222 Points

    Error in CodeChallenge: Handling Error Events in Node.js

    Posted August 18, 2018 8:57pm by lukej
    lukej
    34,222 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    0 Answers

  • Marcus Schumacher
    Marcus Schumacher
    16,616 Points

    Can't get try catch block to work properly

    Posted August 8, 2018 1:28am by Marcus Schumacher
    Marcus Schumacher
    16,616 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • Ellis Corio
    Ellis Corio
    22,035 Points

    can anyone tell me what is wrong with this error handler?

    Posted July 12, 2018 11:12am by Ellis Corio
    Ellis Corio
    22,035 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    4 Answers

  • Jake Kobs
    Jake Kobs
    9,215 Points

    Question about .on method

    Posted June 2, 2018 10:40pm by Jake Kobs
    Jake Kobs
    9,215 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    2 Answers

  • Ted Moxon
    Ted Moxon
    18,203 Points

    Im not getting the same errors.

    Posted March 18, 2018 3:47am by Ted Moxon
    Ted Moxon
    18,203 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • benjaminmosery
    benjaminmosery
    6,346 Points

    Unexpected Token )

    Posted March 2, 2018 11:51pm by benjaminmosery
    benjaminmosery
    6,346 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    3 Answers

  • Matthew Conrad
    Matthew Conrad
    28,069 Points

    Error not thrown even in error state

    Posted December 20, 2017 3:03am by Matthew Conrad
    Matthew Conrad
    28,069 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • Moustafa Nassr
    Moustafa Nassr
    838 Points

    cant figure out whats wrong

    Posted September 6, 2017 7:55pm by Moustafa Nassr
    Moustafa Nassr
    838 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    2 Answers

  • saber
    saber
    13,276 Points

    Getting a different error on local computer.

    Posted August 6, 2017 6:04am by saber
    saber
    13,276 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • bobcat
    bobcat
    13,623 Points

    What is the difference? log() vs error()

    Posted July 2, 2017 4:34pm by bobcat
    bobcat
    13,623 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    1 Answer

  • James Barrett
    James Barrett
    13,253 Points

    Could someone clarify what Andrew is saying here?

    Posted April 10, 2017 10:17pm by James Barrett
    James Barrett
    13,253 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    3 Answers

  • Anthony Scott
    PLUS
    Anthony Scott
    Courses Plus Student 9,001 Points

    Not getting the proper error.

    Posted March 21, 2017 5:56pm by Anthony Scott
    Anthony Scott
    Courses Plus Student 9,001 Points
    • JavaScript
    • Node.js Basics 2017
    • Handling Errors in Node
    • Handling the Error Event in Node

    2 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord