Skip to content

Commit 4899940

Browse files
authored
fix(widget-builder): Wrap each section in error boundary (#91762)
Some sections are triggering errors. Wrap every section in an error boundary so it doesn't completely break the page.
1 parent b18f6ee commit 4899940

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

static/app/views/dashboards/widgetBuilder/components/widgetBuilderSlideout.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import pick from 'lodash/pick';
77
import {Breadcrumbs} from 'sentry/components/breadcrumbs';
88
import {openConfirmModal} from 'sentry/components/confirm';
99
import {Button} from 'sentry/components/core/button';
10+
import ErrorBoundary from 'sentry/components/errorBoundary';
1011
import SlideOverPanel from 'sentry/components/slideOverPanel';
1112
import {URL_PARAM} from 'sentry/constants/pageFilters';
1213
import {IconClose} from 'sentry/icons';
@@ -307,6 +308,14 @@ function WidgetBuilderSlideout({
307308

308309
export default WidgetBuilderSlideout;
309310

311+
function Section({children}: {children: React.ReactNode}) {
312+
return (
313+
<SectionWrapper>
314+
<ErrorBoundary mini>{children}</ErrorBoundary>
315+
</SectionWrapper>
316+
);
317+
}
318+
310319
const CloseButton = styled(Button)`
311320
color: ${p => p.theme.subText};
312321
height: fit-content;
@@ -332,6 +341,6 @@ const SlideoutBodyWrapper = styled('div')`
332341
padding: ${space(4)};
333342
`;
334343

335-
const Section = styled('div')`
344+
const SectionWrapper = styled('div')`
336345
margin-bottom: 24px;
337346
`;

0 commit comments

Comments
 (0)