title: How to use domains to handle exception in node js app
body: <p>In my node js app i want to catch the exception using domains.How can i do this.I have tried the below example but it showing error as 'Error: Cannot find module 'step''..</p>
  
  <p>app.js</p>
  
  <pre><code>            var domain=require('domain');
              var mainDomain = domain.create();
              mainDomain.run(function() {
              fs.readFile(filename, 'utf8', mainDomain.intercept(function(data) {
                 console.log(data);      
              }));               
               });
              mainDomain.on("error", function(error){
                 console.log(error);
              });
  </code></pre>