Automatic feedback on JavaScript error

前端 未结 6 1035
再見小時候
再見小時候 2020-12-23 22:56

Is there a way to get an automatic feedback if an error (even syntax errors) occurs when running a JavaScript on the client side?

I was thinking of something like th

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-23 23:27

    window.onerror = MyFunction(msg,url,line);

    we pop up a window with the error details, browser type (i.e. navigator.userAgent), etc. all in fields marked READONLY and inviting the user to Submit them.

    We have a checkbox "Don't show this again" which is stored in a session cookie - so if they keep getting errors than can disable the Popup.

    Despite the fact that we thought this was "well cool", we get very few reports - and I'm not convinced that that is because we get close to zero runtime errors!

提交回复
热议问题