verror.js 406 B

12345678910111213
  1. var mod_fs = require('fs');
  2. var mod_verror = require('../lib/verror');
  3. var filename = '/nonexistent';
  4. mod_fs.stat(filename, function (err1) {
  5. var err2 = new mod_verror.VError(err1, 'failed to stat "%s"', filename);
  6. /* The following would normally be higher up the stack. */
  7. var err3 = new mod_verror.VError(err2, 'failed to handle request');
  8. console.log(err3.message);
  9. console.log(err3.stack);
  10. });