browserify / browserify/node-util

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

Offen
#29 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
255
Forks
92
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

`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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.