feat(react): Allow for scope to be accessed before error#2753
Merged
AbhiPrasad merged 4 commits intomasterfrom Jul 20, 2020
Merged
feat(react): Allow for scope to be accessed before error#2753AbhiPrasad merged 4 commits intomasterfrom
AbhiPrasad merged 4 commits intomasterfrom
Conversation
1a095bf to
43eb8c7
Compare
Contributor
Contributor
size-limit report
|
HazAT
requested changes
Jul 20, 2020
packages/react/src/errorboundary.tsx
Outdated
| /** Called on componentWillUnmount() */ | ||
| onUnmount?(error: Error | null, componentStack: string | null, eventId: string | null): void; | ||
| /** Called before error is sent to Sentry, allows for you to add tags or context using the scope */ | ||
| beforeSend?(scope: Scope, error: Error | null, componentStack: string | null): void; |
Member
There was a problem hiding this comment.
Can we call this method differently, I don't like that we now can confuse global beforeSend with this one since it's also works differently.
Alternative: beforeCapture
Contributor
Author
There was a problem hiding this comment.
Changed to beforeCapture 👍
Contributor
|
Other than Daniel's comment 👍 |
43eb8c7 to
486f402
Compare
Co-authored-by: Daniel Griesser <daniel.griesser.86@gmail.com>
HazAT
approved these changes
Jul 20, 2020
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.
This change allows users to update the scope before the error boundary sends an error to Sentry.
This was requested so that users can add specific tags or fingerprints before an error is sent to Sentry based on the error and componentStack.