Error handling in node.js index