File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import {autobind} from 'core-decorators';
9
9
10
10
import Switchboard from '../switchboard' ;
11
11
import FilePatchView from '../views/file-patch-view' ;
12
+ import ErrorBoundary from '../views/error-boundary' ;
12
13
import ModelObserver from '../models/model-observer' ;
13
14
import FilePatch from '../models/file-patch' ;
14
15
@@ -171,6 +172,10 @@ export default class FilePatchController extends React.Component {
171
172
}
172
173
173
174
render ( ) {
175
+ return < ErrorBoundary > { this . renderDetails ( ) } </ ErrorBoundary > ;
176
+ }
177
+
178
+ renderDetails ( ) {
174
179
const hunks = this . state . filePatch ? this . state . filePatch . getHunks ( ) : [ ] ;
175
180
const repository = this . repositoryObserver . getActiveModel ( ) ;
176
181
if ( repository . isUndetermined ( ) || repository . isLoading ( ) ) {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import yubikiri from 'yubikiri';
6
6
import RemotePrController from './remote-pr-controller' ;
7
7
import GithubLoginModel from '../models/github-login-model' ;
8
8
import ObserveModel from '../views/observe-model' ;
9
+ import ErrorBoundary from '../views/error-boundary' ;
9
10
import { RemotePropType } from '../prop-types' ;
10
11
11
12
class RemoteSelector extends React . Component {
@@ -70,9 +71,11 @@ export default class GithubTabController extends React.Component {
70
71
71
72
render ( ) {
72
73
return (
73
- < ObserveModel model = { this . props . repository } fetchData = { this . fetchModelData } >
74
- { data => { return data ? this . renderWithData ( data ) : null ; } }
75
- </ ObserveModel >
74
+ < ErrorBoundary >
75
+ < ObserveModel model = { this . props . repository } fetchData = { this . fetchModelData } >
76
+ { data => { return data ? this . renderWithData ( data ) : null ; } }
77
+ </ ObserveModel >
78
+ </ ErrorBoundary >
76
79
) ;
77
80
}
78
81
You can’t perform that action at this time.
0 commit comments