Skip to content

Raygun ignores Syntax errors during page loading when ignore3rdPartyErrors enabled #371

Description

@Obi-Dann

Hello,

I have ignore3rdPartyErrors enabled to reduce the noise from browser extensions, but it also prevents errors caught during the initial JS bundle loading to be ignored.
Before rg4js is loaded, it attaches a handler to window.onError, but it ignores every bit of useful information there only using the value of msg which is just a string that does not have any stack trace.

windw.onerror = function (msg, url, line, col, err) {
if (originalOnError) {
originalOnError(msg, url, line, col, err);
}
if (!err) {
err = new Error(msg);
}
windw['rg4js'].q = windw['rg4js'].q || [];
windw['rg4js'].q.push({e: err});
};

Because the error does not have stack trace, it gets ignored by ignore3rdPartyErrors.

Possible solution would be to extend that error with other data from onError like line number, filename etc and stop that error from being ignored by ignore3rdPartyErrors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions