werror.js 437 B

1234567891011121314
  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.WError(err1, 'failed to stat "%s"', filename);
  6. /* The following would normally be higher up the stack. */
  7. var err3 = new mod_verror.WError(err2, 'failed to handle request');
  8. console.log(err3.message);
  9. console.log(err3.toString());
  10. console.log(err3.stack);
  11. });