@@ -9,6 +9,7 @@ import {defineMessages, injectIntl, intlShape} from 'react-intl';
99import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx' ;
1010import { openExtensionLibrary } from '../reducers/modals' ;
1111import {
12+ getIsError ,
1213 getIsShowingProject
1314} from '../reducers/project-state' ;
1415import { setProjectTitle } from '../reducers/project-title' ;
@@ -63,16 +64,16 @@ class GUI extends React.Component {
6364 }
6465 }
6566 render ( ) {
66- if ( this . props . loadingError ) {
67+ if ( this . props . isError ) {
6768 throw new Error (
68- `Failed to load project from server [id =${ window . location . hash } ]: ${ this . props . errorMessage } ` ) ;
69+ `Error in Scratch GUI [location =${ window . location } ]: ${ this . props . error } ` ) ;
6970 }
7071 const {
7172 /* eslint-disable no-unused-vars */
7273 assetHost,
73- errorMessage ,
74+ error ,
7475 hideIntro,
75- loadingError ,
76+ isError ,
7677 isShowingProject,
7778 onUpdateProjectId,
7879 onUpdateReduxProjectTitle,
@@ -100,14 +101,14 @@ class GUI extends React.Component {
100101GUI . propTypes = {
101102 assetHost : PropTypes . string ,
102103 children : PropTypes . node ,
103- errorMessage : PropTypes . string ,
104+ error : PropTypes . oneOfType ( [ PropTypes . object , PropTypes . string ] ) ,
104105 fetchingProject : PropTypes . bool ,
105106 hideIntro : PropTypes . bool ,
106107 importInfoVisible : PropTypes . bool ,
107108 intl : intlShape ,
109+ isError : PropTypes . bool ,
108110 isLoading : PropTypes . bool ,
109111 isShowingProject : PropTypes . bool ,
110- loadingError : PropTypes . bool ,
111112 loadingStateVisible : PropTypes . bool ,
112113 onSeeCommunity : PropTypes . func ,
113114 onUpdateProjectId : PropTypes . func ,
@@ -135,7 +136,9 @@ const mapStateToProps = (state, ownProps) => {
135136 connectionModalVisible : state . scratchGui . modals . connectionModal ,
136137 costumeLibraryVisible : state . scratchGui . modals . costumeLibrary ,
137138 costumesTabVisible : state . scratchGui . editorTab . activeTabIndex === COSTUMES_TAB_INDEX ,
139+ error : state . scratchGui . projectState . error ,
138140 importInfoVisible : state . scratchGui . modals . importInfo ,
141+ isError : getIsError ( loadingState ) ,
139142 isPlayerOnly : state . scratchGui . mode . isPlayerOnly ,
140143 isRtl : state . locales . isRtl ,
141144 isShowingProject : getIsShowingProject ( loadingState ) ,
0 commit comments