Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140331

How to avoid Node.Js app quit when there's a Javascript error?

$
0
0

Suppose I have the following typo in my Node.Js app Javascript code:

    max_weight = Match.floor(max_weight/min_weight)

It's supposed to be Math.floor instead of Match.floor so when the code executes I get the error:

ReferenceError: Match is not defined

and then my Node.Js app quits.

How can I ensure that even if an error like this occurs, the app does not quit but simply reports the error and continues the code execution?

I understand I should solve problems like this before launching into production, but, still, what if I want the code to continue the execution despite the error?


Viewing all articles
Browse latest Browse all 140331

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>