Use fstream stack for more meaningful stack traces.

This commit is contained in:
André Cruz
2013-07-27 19:23:23 +01:00
parent fcbefa218b
commit 38fb72ece9

View File

@@ -56,11 +56,11 @@ StandardRenderer.prototype.error = function (err) {
// Print trace if verbose, the error has no code
// or if the error is a node error
if (this._config.verbose || !err.code || err.errno) {
// TODO: In some situations, err.stack is meaningless
// Investigate why and find alternatives
/*jshint camelcase:false*/
str = '\nStack trace:\n'.yellow;
str += (err.stack || 'N/A') + '\n';
str += (err.fstream_stack ? err.fstream_stack.join('\n') : err.stack || 'N/A') + '\n';
str += '\nConsole trace:\n'.yellow;
/*jshint camelcase:true*/
this._write(process.stderr, str);
console.trace();