title: Handle errors thrown by require() module in node.js
body: <p>having a bit of a snag in my code when trying to require() modules that don't exists.
  The code loops through a directory and does a <code>var appname = require('path')</code> on each folder. This works for appropriately configured modules but throws: <code>Error: Cannot find module</code> when the loop hits a non-module.</p>
  
  <p>I want to be able to handle this error gracefully, instead of letting it stop my entire process. So in short, how does one catch an error thrown by <code>require()</code>?</p>
  
  <p>thanks!</p>