diff --git a/src/OutputHandler.js b/src/OutputHandler.js index 8962a12..9842d77 100755 --- a/src/OutputHandler.js +++ b/src/OutputHandler.js @@ -208,8 +208,12 @@ class OutputHandler { * * @param {String} mainError message to send */ - outputErrorMessage(mainError) { - console.error( chalk.red(JSON.stringify(mainError)) ); + errorMessage(mainError) { + let errStr = ""+mainError; + if(errStr == "[object Object]") { + errStr = JSON.stringify(mainError); + } + console.error( chalk.red(errStr) ); } /** diff --git a/src/cli-command/project/run.js b/src/cli-command/project/run.js index 97e4ec4..6037508 100644 --- a/src/cli-command/project/run.js +++ b/src/cli-command/project/run.js @@ -948,7 +948,7 @@ module.exports = { // Looks ok, lets normalized it to dataObject argv.dataObject = JSON.stringify( dataJsonObj ); } catch(e) { - OutputHandler.outputErrorMessage(e); + OutputHandler.errorMessage(e); OutputHandler.cliArgumentError( `Invalid format for dataObject` ) } } @@ -1014,7 +1014,7 @@ module.exports = { // Looks ok, lets normalized it to secretObject argv.secretObject = JSON.stringify( secretJsonObj ); } catch(e) { - console.log(e) + OutputHandler.errorMessage(e) OutputHandler.cliArgumentError( `Invalid format for secretFile : ${secretFile}` ) } }