feat: Allow to pass errorHandler as record option#1107
Merged
YunFeng0817 merged 3 commits intorrweb-io:masterfrom Mar 22, 2023
Merged
feat: Allow to pass errorHandler as record option#1107YunFeng0817 merged 3 commits intorrweb-io:masterfrom
errorHandler as record option#1107YunFeng0817 merged 3 commits intorrweb-io:masterfrom
Conversation
Juice10
reviewed
Feb 9, 2023
e5c5f40 to
636e1ec
Compare
YunFeng0817
approved these changes
Mar 19, 2023
🦋 Changeset detectedLatest commit: 4144e08 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Author
|
I resolved the merge commits and added a changeset! |
Member
|
Sorry, one more thing before merging this. Could you also add the description of this config in the rrweb doc? |
Contributor
Author
Ah sure, of course! I added this to the guide doc as well. |
Member
Contributor
Author
Member
|
Yes, I resolved it in another PR. |
This was referenced Jul 6, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

We've been playing around quite a lot with ways to handle errors that originate somewhere from within rrwebs deep callback stack. This PR adds an option to add a
errorHandleroption torecord, which can be used to either swallow errors or handle them in different ways:I tried to wrap all places that are called as (async) callbacks somewhere. I may have missed a place, but IMHO this should give a pretty decent coverage.
Note that in order to do that, I had to rewrite the monkey patching we are doing on e.g.
CSSStyleSheetto use a proxy. Otherwise, retaining thethiscontext correctly turned out quite tricky. IMHO this is a nicer approach anyhow, and all supported browsers (> IE11) support proxies, so should be OK I think.