-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: Allow to pass errorHandler
as record option
#1107
Conversation
e5c5f40
to
636e1ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is a good mechanism. Using "Proxy" constructor will make the browser compatibility worse. Otherwise, it's a good way to do patching things.
Could you please solve the merge conflicts and add a change log for this one?
🦋 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 |
I resolved the merge commits and added a changeset! |
Sorry, one more thing before merging this. Could you also add the description of this config in the rrweb doc? |
Ah sure, of course! I added this to the guide doc as well. |
Yes, I resolved it in another PR. |
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
errorHandler
option 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.
CSSStyleSheet
to use a proxy. Otherwise, retaining thethis
context 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.