errors icon indicating copy to clipboard operation
errors copied to clipboard

Stack trace doesn't include error message in Node 5

Open myndzi opened this issue 9 years ago • 0 comments

Code:

var errors = require('errors');
errors.create({ name: 'FooError' });
throw new errors.FooError('custom message');

Output:

myndzi@tetrisguide:~/foo$ node -v
v0.10.33
myndzi@tetrisguide:~/foo$ node test

/home/myndzi/foo/test.js:7
throw new errors.FooError('custom message');
      ^
Error: custom message
    at Object.<anonymous> (/home/myndzi/foo/test.js:7:7)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
myndzi@seckzi:~/conjoined$ node -v
v5.3.0
myndzi@seckzi:~/conjoined$ node errorstest.js

/home/myndzi/conjoined/errorstest.js:7
throw new errors.FooError('custom message');
^
Error
    at Object.<anonymous> (/home/myndzi/conjoined/errorstest.js:7:7)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
    at startup (node.js:141:18)
    at node.js:980:3

myndzi avatar Mar 26 '16 15:03 myndzi