Cordova app: A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll RRS feed

  • Question

  • I get the error message as stated above. Internet search shows me that this error can be thrown when an error occurs in a javascript:


    Now, no error occurs in the browser; only in the app. I have dozens of javascript files, 3rd party javascript libraries and so on, so putting try/catch blocks around virtually everything would cost weeks. I tried to put one try/catch block around the content of every file, but it seems that this won't catch errors thrown asynchronous inside functions, like through setTimeout or events.

    Is there an easy way to get the file, line and column of the JavaScript error that is effectively causing the aforementioned exception?

    • Edited by Alexander U Monday, April 13, 2015 12:04 PM
    Monday, April 13, 2015 12:04 PM


  • Hi Alexander,

    I have no good suggestions currently but looks like https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror might help.

    As I understand no matter the exception thrown by async methods or sync method, window.onerror will always catch the global errors unless if you have handled them.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Jamles Hez Tuesday, April 21, 2015 5:56 AM
    • Marked as answer by Jamles Hez Wednesday, April 22, 2015 6:20 AM
    Tuesday, April 14, 2015 1:56 AM