Closed as not planned
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/gatsby
SDK Version
7.67.0
Framework Version
@sentry/react
Steps to Reproduce
I have a root component that wraps other children, and I would like to be able to use both beforeCapture
(child and parent) but I'm unable to propagate beforeCapture
or any method within withErrorBoundary
. Is there a way? Thank you.
export default Sentry.withErrorBoundary(RootElementWrapper, {
beforeCapture: (scope, error) => {
console.log("do something else", error);
scope.setTag("error",error.mesage)
},
});
and
export default Sentry.withErrorBoundary(PageElementWrapper, {
beforeCapture: (scope, error) => {
console.log("do something", error);
scope.setTag("location","page")
},
});
Only the child's beforeCapture
is working.
Expected Result
Both tags should be set: Child and parent.
Actual Result
Only the child withErrorBoundary is catching the error. The parent ignores it.
Alternative
Could this be a solution, if added to every child? This way the children would set the tag and whenever there is an error, the parent would react with withErrorBoundary.
useEffect(() => {
Sentry.configureScope((scope) => {
scope.setTag("location", "checkout");
});
}, []);
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Waiting for: Product Owner
Status
No status