Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable uncaught error capture for web workers #929

Merged
merged 2 commits into from
Mar 3, 2021

Conversation

waltjones
Copy link
Contributor

@waltjones waltjones commented Feb 24, 2021

Description of the change

  • Safely check for undefined window and document, so non-window global objects work correctly. With this bug fixed, captureUncaught can be set in a Web Worker’s Rollbar instance and errors will be reported with full stack information.
  • Add an additional check when identifying Chrome "anonymous" errors, skipping uncaught errors from web workers that have null Error objects but do not get sent to prepareStackTrace().

Currently there aren't tests specifically for web workers. I looked into whether this is possible with the current Karma test framework, and ran into problems stubbing interfaces in the separate worker context. For now the functionality has been tested manually.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fixes ch80345

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@waltjones waltjones changed the title WIP: Enable uncaught error capture for web workers Enable uncaught error capture for web workers Feb 25, 2021
Copy link
Contributor

@ajtran ajtran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me! Thanks for the detailed description!

@bxsx bxsx self-requested a review February 25, 2021 18:49
Copy link
Contributor

@bxsx bxsx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@waltjones waltjones merged commit 1d59d0f into master Mar 3, 2021
mudetroit pushed a commit that referenced this pull request Mar 14, 2024
* fix: safely check for document and window

* fix: don't treat web worker errors as anonymous in chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants