Front-end error monitoring

Front-end misclassification:

    Immediate run error: Code error

    resource loading error

Wrong way to catch:

    How to catch the error on the fly:

        try.catch    window.onerror

    Resource loading error:

        object.onerror This error will not bubble up and needs to be monitored in capture mode

        performance.getEntries Get the loading market of loaded resources, you can indirectly get the unloaded resources

        Error event capture window.addEventListener('error', function(e){ }, true) must be event capture

Rationale for reporting errors:

    Report using ajax communication

    Use the image object to report (new Image()).src = '//baidu.com?error=one'

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325590736&siteId=291194637