locked
WinJS.Application.onerror exception and grab StackTrace

    Question

  • In my WinJS, Windows 8.1 app I have a global exception handler in default.js like this

    WinJS.Application.onerror = function(err) {
        //  handle the excep here
        var msg = err.detail.errorMessage;
        var the_path =  err.detail.errorUrl;
        var the_line = err.detail.errorLine;
    }

    How do I grab the stack trace here so I can report it? - or the call stack I guess.

    Thanks


    Phil

    Thursday, February 27, 2014 7:22 PM

All replies

  • Hi Phil,

    Since Windows Store App for HTML5/WinJS is using the same render engine as IE, so simply search this question on the Internet. If the solution works fine with IE, then it should work as same as Windows Store App.

    You could use some third party library for helping with collect the stack trace, for instance a post from StackOverFlow suggest to use stacktrace.js for helping with this.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, February 28, 2014 3:07 AM
    Moderator