You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/10/20 03:16:37 UTC

[GitHub] [cordova-js] erisu commented on a change in pull request #211: Improve callback error handling

erisu commented on a change in pull request #211: Improve callback error handling
URL: https://github.com/apache/cordova-js/pull/211#discussion_r336761485
 
 

 ##########
 File path: src/cordova.js
 ##########
 @@ -226,9 +226,7 @@ var cordova = {
             }
         } catch (err) {
             var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err;
-            console && console.log && console.log(msg);
-            console && console.log && err.stack && console.log(err.stack);
-            cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg });
+            cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg, 'original': err });
 
 Review comment:
   Would the property name `original` sound better if it is `error`, `stack`, or `errorStack`.
   
   Once the property name is set and used, I am not sure if it would be changed it in the future if we find the name to be confusing.
   
   People could build custom tooling that relays on this new field name and changing would break their tools.
   
   Just want to make sure the meaning of the property carries over.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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