CB-12683: fixed error handling
diff --git a/src/cli.js b/src/cli.js
index 63b7763..184a801 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -275,10 +275,12 @@
var args = nopt(knownOpts, shortHands, inputArgs);
- // For CordovaError print only the message without stack trace unless we
- // are in a verbose mode.
process.on('uncaughtException', function(err) {
- logger.error(err);
+ if(err.message) {
+ logger.error(err.message);
+ } else {
+ logger.error(err);
+ }
// Don't send exception details, just send that it happened
if(shouldCollectTelemetry) {
telemetry.track('uncaughtException');