Skip to content

Commit 1f8de57

Browse files
authored
fix(react): Add actual error name to boundary error name (#9065)
Previously, the error name would always be `React ErrorBoundary Error`, because `errorBoundaryError.name` refers to the name of the Error object that was just created.
1 parent 8001498 commit 1f8de57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/src/errorboundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundarySta
128128
// See: https://github.com/getsentry/sentry-javascript/issues/6167
129129
if (isAtLeastReact17(React.version) && isError(error)) {
130130
const errorBoundaryError = new Error(error.message);
131-
errorBoundaryError.name = `React ErrorBoundary ${errorBoundaryError.name}`;
131+
errorBoundaryError.name = `React ErrorBoundary ${error.name}`;
132132
errorBoundaryError.stack = componentStack;
133133

134134
// Using the `LinkedErrors` integration to link the errors together.

0 commit comments

Comments
 (0)