I have a node.js script and anytime an error happens node.js stops running with the error that happened.
What is the proper way of checking errors in node.js so it won’t break the script and cause node.js to stop?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can catch otherwise uncaught errors by setting the following:
Of course, if you run your script in something like forever or node-supervisor, when your script “stops” it will start back up, which might solve your problem.