From 9be70ca2d0ff928e2ebbcf8e9a15ce89a7b90e2a Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Thu, 24 May 2018 13:41:15 -0400
Subject: [PATCH] Move error boundary out beyond the project loader

---
 src/containers/gui.jsx | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx
index 59e5b9426..79a85c9dc 100644
--- a/src/containers/gui.jsx
+++ b/src/containers/gui.jsx
@@ -5,7 +5,7 @@ import VM from 'scratch-vm';
 import {connect} from 'react-redux';
 import ReactModal from 'react-modal';
 
-import ErrorBoundary from './error-boundary.jsx';
+import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx';
 import {openExtensionLibrary} from '../reducers/modals';
 import {
     activateTab,
@@ -75,15 +75,13 @@ class GUI extends React.Component {
             ...componentProps
         } = this.props;
         return (
-            <ErrorBoundary action="Top Level App">
-                <GUIComponent
-                    loading={fetchingProject || this.state.loading || loadingStateVisible}
-                    vm={vm}
-                    {...componentProps}
-                >
-                    {children}
-                </GUIComponent>
-            </ErrorBoundary>
+            <GUIComponent
+                loading={fetchingProject || this.state.loading || loadingStateVisible}
+                vm={vm}
+                {...componentProps}
+            >
+                {children}
+            </GUIComponent>
         );
     }
 }
@@ -129,7 +127,9 @@ const ConnectedGUI = connect(
     mapDispatchToProps,
 )(GUI);
 
-const WrappedGui = ProjectLoaderHOC(vmListenerHOC(ConnectedGUI));
+const WrappedGui = ErrorBoundaryHOC('Top Level App')(
+    ProjectLoaderHOC(vmListenerHOC(ConnectedGUI))
+);
 
 WrappedGui.setAppElement = ReactModal.setAppElement;
 export default WrappedGui;
-- 
GitLab