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/09/23 18:23:30 UTC

[GitHub] [cordova-js] Lindsay-Needs-Sleep opened a new pull request #211: Improve callback error handling

Lindsay-Needs-Sleep opened a new pull request #211: Improve callback error handling
URL: https://github.com/apache/cordova-js/pull/211
 
 
   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   All
   
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   Problems solved:
   - Allow users to get the stack trace for errors via `cordovacallbackerror` event
   - Remove redundant console logs
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   
   
   ### Description
   <!-- Describe your changes in detail -->
   Improve error handling.
   - Add 'original' parameter to the 'cordovacallbackerror' event so that users can view the actual original error.  
       - This is extremely important so that users can get the stack trace for logging and debugging.
   - Removed the console logs.
       - They were redundant since the error is printed when it is thrown anyways.
       - console.log's without an option to turn them off can be annoying.
   
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   `npm test`
     * all passed.
     * Added test for this change.  (Passed)
   
   Ran mobile spec before and after.  
     * Test results were unchanged.  
     * 10 cordova-plugin-file-tests failed both times.  See screen shot.  
       * If someone can tell me what to do to make those work I will re-run.  
       * (I have the cordova-labs#cordova-filetranfer server running, and have set FILETRANSFER_SERVER_ADDRESS.  This fixed a couple tests.)
   
   Manual testing.
     * See before and after photos of default output.
     * tested `window.addEventListener("cordovacallbackerror", function (err) {`
   
   
   **before**:
   ![image](https://user-images.githubusercontent.com/51773923/65451504-8be44200-ddfc-11e9-88bf-c2f920c588ad.png)
   
   **after**:
   ![image](https://user-images.githubusercontent.com/51773923/65451520-9272b980-ddfc-11e9-8acb-aee57e4b8121.png)
   
   **mobilespec**:
   ![image](https://user-images.githubusercontent.com/51773923/65451553-a1f20280-ddfc-11e9-94fc-193f1078413a.png)
   
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [x] I added automated test coverage as appropriate for this change
   - [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   

----------------------------------------------------------------
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