fix: handle string errors

This commit is contained in:
Pooya Parsa 2018-03-16 23:48:19 +03:30
parent 3f83921c71
commit 5d0deefa6a
1 changed files with 2 additions and 2 deletions

View File

@ -10,9 +10,9 @@ export const printWarn = function (msg, from) {
}
export const renderError = function (_error, from) {
const errStr = _error.stack
const errStr = _error.stack || String(_error)
const fromStr = from ? Chalk.red(` ${from}`) : ''
return '\n' + Chalk.bgRed.black(' ERROR ') + fromStr + '\n\n' + errStr
return '\n' + Chalk.bgRed.black(' ERROR ') + fromStr + ' ' + errStr
}
export const printError = function () {