Skip to content

Commit

Permalink
fix: don't treat web worker errors as anonymous in chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones committed Feb 25, 2021
1 parent 778da22 commit c32e4d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/browser/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@ Rollbar.prototype.handleUncaughtException = function(message, url, lineno, colno

// Chrome will always send 5+ arguments and error will be valid or null, not undefined.
// If error is undefined, we have a different caller.
if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {
// Chrome also sends errors from web workers with null error, but does not invoke
// prepareStackTrace() for these. Test for empty url to skip them.
if (this.options.inspectAnonymousErrors && this.isChrome && (error === null) && (url === '')) {
return 'anonymous';
}

Expand Down

0 comments on commit c32e4d7

Please sign in to comment.