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?
Self-hosted/on-premise
Which SDK are you using?
@sentry/browser
SDK Version
7.57.0
Framework Version
7.57.0
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: <redacted>,
integrations: integrations,
release: `${$BUILD_FLAVOR}-${$REVISION}`,
environment: $BUILD_FLAVOR,
transport: (transportOptions: BrowserTransportOptions) =>
makeFetchTransport(transportOptions, fetchImpl),
maxBreadcrumbs: 100,
sendClientReports: false,
beforeSend: (event: Event, hint?: EventHint) => {
<redacted>
/**
* Essentially, here if the event.exception.values[0] is of the type that we want to skip, we return null,
* otherwise we just return the event.
*/
},
});
Steps to Reproduce
Throw an error from a function (let's call it MessageRenderer) that returns React components based on certain conditions, and in one of the conditions it throws an error.
The return of this function is wrapped in sentry react's ErrorBoundary component.
Expected Result
When looking at the exception.values list in the event object in the beforeSend function, based on the docs (link: https://develop.sentry.dev/sdk/event-payloads/exception/), I was expecting the original error thrown from the function (MessageRenderer from my example above) to be present in the first index, followed by the ErrorBoundary error.
Actual Result
But, the first index (index 0) is taken up by the React ErrorBoundary Error object and the second index (index 1) contains the original thrown error. This is opposite of what is mentioned in the docs.
Am I missing something or is Error Boundary a unique case where this is not true?
Metadata
Metadata
Assignees
Type
Projects
Status
Status