cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dase...@apache.org
Subject cordova-lib git commit: CB-11131 Fix TypeError: message.toUpperCase is not a function in CordovaLogger
Date Wed, 27 Apr 2016 05:36:05 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master b65196413 -> 5867657d9


CB-11131 Fix TypeError: message.toUpperCase is not a function in CordovaLogger


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/5867657d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/5867657d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/5867657d

Branch: refs/heads/master
Commit: 5867657d989b136702fe2f14172661ca489573ed
Parents: b651964
Author: daserge <v-seshak@microsoft.com>
Authored: Thu Apr 21 15:50:19 2016 +0300
Committer: daserge <v-seshak@microsoft.com>
Committed: Tue Apr 26 20:00:31 2016 +0300

----------------------------------------------------------------------
 cordova-common/src/CordovaLogger.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/5867657d/cordova-common/src/CordovaLogger.js
----------------------------------------------------------------------
diff --git a/cordova-common/src/CordovaLogger.js b/cordova-common/src/CordovaLogger.js
index 0a4a49c..dc49a4b 100644
--- a/cordova-common/src/CordovaLogger.js
+++ b/cordova-common/src/CordovaLogger.js
@@ -89,7 +89,7 @@ CordovaLogger.prototype.log = function (logLevel, message) {
     var isVerbose = this.logLevel === 'verbose';
     var cursor = this.stdoutCursor;
 
-    if(message instanceof Error || logLevel === CordovaLogger.ERROR) {
+    if (message instanceof Error || logLevel === CordovaLogger.ERROR) {
         message = formatError(message, isVerbose);
         cursor = this.stderrCursor;
     }
@@ -196,10 +196,10 @@ CordovaLogger.prototype.subscribe = function (eventEmitter) {
 function formatError(error, isVerbose) {
     var message = '';
 
-    if(error instanceof CordovaError) {
+    if (error instanceof CordovaError) {
         message = error.toString(isVerbose);
-    } else if(error instanceof Error) {
-        if(isVerbose) {
+    } else if (error instanceof Error) {
+        if (isVerbose) {
             message = error.stack;
         } else {
             message = error.message;
@@ -209,7 +209,7 @@ function formatError(error, isVerbose) {
         message = error;
     }
 
-    if(message.toUpperCase().indexOf('ERROR:') !== 0) {
+    if (typeof message === 'string' && message.toUpperCase().indexOf('ERROR:') !==
0) {
         // Needed for backward compatibility with external tools
         message = 'Error: ' + message;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message