title: Catch exception in node during JSON.parse
body: <p>My node server dies when it is unable to parse JSON in the following line:</p>
  
  <pre><code>var json = JSON.parse(message);
  </code></pre>
  
  <p>I read <a href="https://stackoverflow.com/questions/7310521/node-js-best-practice-exception-handling">this thread</a> on how to catch exceptions in node, but I am still not sure what is the proper way to wrap a try and catch block around this statement. My goal is to catch the exception and log an error to the console, and of course keep the server alive. Thank you.</p>