diff --git a/packages/react/src/errorboundary.tsx b/packages/react/src/errorboundary.tsx index d3c831e24357..3d894fc699a8 100644 --- a/packages/react/src/errorboundary.tsx +++ b/packages/react/src/errorboundary.tsx @@ -1,6 +1,6 @@ import type { ReportDialogOptions, Scope } from '@sentry/browser'; import { captureException, getCurrentHub, showReportDialog, withScope } from '@sentry/browser'; -import { isError, logger } from '@sentry/utils'; +import { addExceptionMechanism, isError, logger } from '@sentry/utils'; import hoistNonReactStatics from 'hoist-non-react-statics'; import * as React from 'react'; @@ -138,7 +138,14 @@ class ErrorBoundary extends React.Component { + addExceptionMechanism(event, { handled: false }) + return event; + }) + const eventId = captureException(error, { contexts: { react: { componentStack } } }); + if (onError) { onError(error, componentStack, eventId); }