Ignore 3rd-Party Errors

When the flag ignore3rdPartyErrors is set to true, the provider ignores any errors that have no stack trace information from 3rd party scripts. This will discard any errors that occur completely within third-party scripts. If there is code loaded from the current domain which is called by third-party function, it will have at least one stack line and will still be sent to Raygun. This option removes nonsense 'Script Errors' from your Raygun dashboard.


Every time a new error is caught and sent to the provider, a function is invoked as a filter when this flag is enabled. This function rejects the incoming trace based on the following criteria:

  1. Reject if it is a script error, or
  2. Reject if it is a browser extension error, or
  3. Reject if it is an invalid stack trace, or
  4. Reject if the stack trace has an invalid domain.

If none of these conditions are met, the error will be accepted and sent to Raygun.

An error is rejected as a script error if all the following conditions are met:

  1. The environment is not React Native, and
  2. The error message starts with "scriptError", and
  3. The first URL in the stack trace is not empty and doesn't match the current host, and
  4. The error occurred on line 0 or the function name is "?" in the stack trace.

An error is rejected as a browser extension error if at least one URL in the stack trace starts with one of the following prefixes:

  • chrome-extension://
  • moz-extension://
  • safari-extension://
  • safari-web-extension://

An error is rejected as having an invalid stack trace if at least one of the following is true:

  1. The stackTrace.message is nil (null or undefined), or
  2. The stack trace is empty, or
  3. All lines in the stack trace are invalid according to the isValidStackLine function. A stack line is considered invalid if at least one of the following is true:
    1. The line number is nil or less than or equal to 0.
    2. The column number is nil or less than or equal to 0.
    3. The URL is nil, or the current URL contains the stack line's URL and the function name is "?".

An error is rejected if at least one of the following is true:

  1. The stack trace is empty or does not contain any valid stack lines with URLs, or
  2. None of the URLs in the stack trace match any of the whitelisted script domains, or
  3. None of the URLs in the stack trace match the current location's host.

On this page: