Pb to catch random JS error, window.onerror doesn't show line number in UIWebView (phone delay) - undefined

I have some user complaining about a bug that I cannot reproduce. I want to send an error to my server every time they receive a JS error. So I use the gobal onerror event, but unfortunately the line number is not listed in the phone table (it works correctly in safari):

window.onerror = function (msg, url, line) {alert ("An error occured:" + msg + "line:" + line "; // line number and url:" undefined "return true;}

How do you feel about JS Runtime errors?


source to share

All Articles