Skip to content

Commit

Permalink
print error stack info when error happens
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyang committed Dec 19, 2017
1 parent 2fa83c4 commit 65a2dd8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/log/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,18 @@ class VConsoleDefaultTab extends VConsoleLogTab {
if (lineNo || colNo) {
msg += ':' + lineNo + ':' + colNo;
}
that.printLog({logType:'error', logs:[msg], noOrigin:true});
//print error stack info
let stack = !!error && !!error.stack;
let statckInfo = (stack && error.stack.toString()) || '';
that.printLog({logType:'error', logs:[msg, statckInfo], noOrigin:true});
if (tool.isFunction(that.windowOnError)) {
that.windowOnError.call(window, message, source, lineNo, colNo, error);
}
};
}

/**
*
*
* @private
*/
evalCommand(cmd) {
Expand Down

0 comments on commit 65a2dd8

Please sign in to comment.