Skip to content

Commit 47a3d82

Browse files
fix(widgets): Add error boundary to widget footer
Wrap the Footer slot content in an ErrorBoundary so that a crashing footer component does not take down the entire widget. The fallback renders WidgetError inside a relative Container so the absolute- positioned error panel stays contained within the footer area. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5f194bc commit 47a3d82

File tree

1 file changed

+12
-2
lines changed
  • static/app/views/dashboards/widgets/widget

1 file changed

+12
-2
lines changed

static/app/views/dashboards/widgets/widget/widget.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Fragment} from 'react';
22
import {css} from '@emotion/react';
33
import styled from '@emotion/styled';
44

5-
import {Flex} from '@sentry/scraps/layout';
5+
import {Container, Flex} from '@sentry/scraps/layout';
66

77
import ErrorBoundary from 'sentry/components/errorBoundary';
88
import {defined} from 'sentry/utils';
@@ -95,7 +95,17 @@ function WidgetLayout(props: Widget) {
9595
)}
9696

9797
{props.Footer && (
98-
<FooterWrapper noPadding={props.noFooterPadding}>{props.Footer}</FooterWrapper>
98+
<FooterWrapper noPadding={props.noFooterPadding}>
99+
<ErrorBoundary
100+
customComponent={({error}) => (
101+
<Container position="relative">
102+
<WidgetError error={error ?? undefined} />
103+
</Container>
104+
)}
105+
>
106+
{props.Footer}
107+
</ErrorBoundary>
108+
</FooterWrapper>
99109
)}
100110
</Frame>
101111
);

0 commit comments

Comments
 (0)