Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util.inspect() on Errors does not include stack trace #29

Open
felixfbecker opened this issue Dec 12, 2018 · 0 comments
Open

util.inspect() on Errors does not include stack trace #29

felixfbecker opened this issue Dec 12, 2018 · 0 comments

Comments

@felixfbecker
Copy link

util.inspect(new Error('foo')) in Node prints the stack trace of the error:

Error: foo
    at repl:1:15
    at Script.runInThisContext (vm.js:122:20)
    at REPLServer.defaultEval (repl.js:334:29)
    at bound (domain.js:395:14)
    at REPLServer.runBound [as eval] (domain.js:408:12)
    at REPLServer.onLine (repl.js:641:10)
    at REPLServer.emit (events.js:187:15)
    at REPLServer.EventEmitter.emit (domain.js:441:20)
    at REPLServer.Interface._onLine (readline.js:301:10)
    at REPLServer.Interface._line (readline.js:673:8)

This shim however just returns

[Error: foo]

Which is really bad if this is used as part of a logging tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant