Skip to content

Commit ae830a9

Browse files
authored
ref(app-platform): Add ErrorBoundary for Sentry App Components (#13511)
* add error boundaries
1 parent 7c83fff commit ae830a9

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

src/sentry/static/sentry/app/components/events/interfaces/frame.jsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Truncate from 'app/components/truncate';
1717
import OpenInContextLine from 'app/components/events/interfaces/openInContextLine';
1818
import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore';
1919
import space from 'app/styles/space';
20+
import ErrorBoundary from 'app/components/errorBoundary';
2021

2122
export function trimPackage(pkg) {
2223
const pieces = pkg.split(/^([a-z]:\\|\\\\)/i.test(pkg) ? '\\' : '/');
@@ -312,12 +313,14 @@ const Frame = createReactClass({
312313
className={className}
313314
>
314315
{hasComponents && (
315-
<OpenInContextLine
316-
key={index}
317-
lineNo={line[0]}
318-
filename={data.filename}
319-
components={components}
320-
/>
316+
<ErrorBoundary mini>
317+
<OpenInContextLine
318+
key={index}
319+
lineNo={line[0]}
320+
filename={data.filename}
321+
components={components}
322+
/>
323+
</ErrorBoundary>
321324
)}
322325
</ContextLine>
323326
);

src/sentry/static/sentry/app/components/group/externalIssuesList.jsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {t} from 'app/locale';
1515
import SentryAppInstallationStore from 'app/stores/sentryAppInstallationsStore';
1616
import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore';
1717
import ExternalIssueStore from 'app/stores/externalIssueStore';
18+
import ErrorBoundary from 'app/components/errorBoundary';
1819

1920
class ExternalIssueList extends AsyncComponent {
2021
static propTypes = {
@@ -130,14 +131,16 @@ class ExternalIssueList extends AsyncComponent {
130131
const issue = (externalIssues || []).find(i => i.serviceType == sentryApp.slug);
131132

132133
return (
133-
<SentryAppExternalIssueActions
134-
key={sentryApp.slug}
135-
group={group}
136-
event={this.props.event}
137-
sentryAppComponent={component}
138-
sentryAppInstallation={installation}
139-
externalIssue={issue}
140-
/>
134+
<ErrorBoundary key={sentryApp.slug} mini>
135+
<SentryAppExternalIssueActions
136+
key={sentryApp.slug}
137+
group={group}
138+
event={this.props.event}
139+
sentryAppComponent={component}
140+
sentryAppInstallation={installation}
141+
externalIssue={issue}
142+
/>
143+
</ErrorBoundary>
141144
);
142145
});
143146
}

src/sentry/static/sentry/app/components/group/sidebar.jsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import {isEqual, pickBy, keyBy, isObject} from 'lodash';
44
import createReactClass from 'create-react-class';
55

6+
import ErrorBoundary from 'app/components/errorBoundary';
67
import SentryTypes from 'app/sentryTypes';
78
import withApi from 'app/utils/withApi';
89
import SuggestedOwners from 'app/components/group/suggestedOwners';
@@ -246,13 +247,16 @@ const GroupSidebar = createReactClass({
246247
project={project}
247248
allEnvironments={this.state.allEnvironmentsGroupData}
248249
/>
249-
<ExternalIssueList
250-
event={this.props.event}
251-
group={this.props.group}
252-
project={project}
253-
orgId={organization.slug}
254-
sentryAppInstallations={sentryAppInstallations}
255-
/>
250+
251+
<ErrorBoundary mini>
252+
<ExternalIssueList
253+
event={this.props.event}
254+
group={this.props.group}
255+
project={project}
256+
orgId={organization.slug}
257+
sentryAppInstallations={sentryAppInstallations}
258+
/>
259+
</ErrorBoundary>
256260

257261
{this.renderPluginIssue()}
258262

0 commit comments

Comments
 (0)