title: Basic node.js question: handling an exception
body: <p>Consider the following code:</p>
  
  <pre><code>var meryl = require('meryl'),
    merylex = require('meryl-extras'),
    staticfile = merylex('staticfile'),
    httpserv = require('http');
  
  meryl.p('GET /static/&lt;filepath&gt;', staticfile({root: 'static', path: 'filepath'}));
  
  httpserv.createServer(meryl.cgi()).listen(3000);
  </code></pre>
  
  <p>This works great, until you request a file that doesn't exist. If I request <code>/static/non-existent-file</code>, the server crashes and says:</p>
  
  <blockquote>
  <pre>/home/user/.node_libraries/meryl-extras/lib/plugins/staticfile.js:224
          chain();
          ^
  TypeError: undefined is not a function
      at CALL_NON_FUNCTION (native)
      at /home/user/.node_libraries/meryl-extras/lib/plugins/staticfile.js:224:9
      at [object Object]. (fs:58:5)
      at [object Object].emit (events:27:15)
      at fs:655:12
      at node.js:608:9</pre>
  </blockquote>
  
  <p>How can I catch this, so my app doesn't crash? Unfortunately, being such a new language, there doesn't seem to be a whole lot of examples that I've been able to find.</p>
  
  <p>Thanks.</p>