Use the error boundary component to semi-gracefully catch errors.

master
Tom Hacohen 7 years ago
parent 5a79fdb6b8
commit 2056c62b80

@ -17,6 +17,7 @@ import NavigationRefresh from 'material-ui/svg-icons/navigation/refresh';
import './App.css'; import './App.css';
import withSpin from './widgets/withSpin'; import withSpin from './widgets/withSpin';
import ErrorBoundary from './components/ErrorBoundary';
import SideMenu from './SideMenu'; import SideMenu from './SideMenu';
import LoginGate from './LoginGate'; import LoginGate from './LoginGate';
import { RouteResolver } from './routes'; import { RouteResolver } from './routes';
@ -192,7 +193,9 @@ class App extends React.PureComponent {
<SideMenu etesync={credentials} onCloseDrawerRequest={this.closeDrawer} /> <SideMenu etesync={credentials} onCloseDrawerRequest={this.closeDrawer} />
</Drawer> </Drawer>
<LoginGate credentials={this.props.credentials} /> <ErrorBoundary>
<LoginGate credentials={this.props.credentials} />
</ErrorBoundary>
</div> </div>
</BrowserRouter> </BrowserRouter>
</MuiThemeProvider> </MuiThemeProvider>

@ -13,6 +13,7 @@ const logo = require('../images/logo.svg');
import { History } from 'history'; import { History } from 'history';
import SideMenuJournals from './SideMenuJournals'; import SideMenuJournals from './SideMenuJournals';
import ErrorBoundary from '../components/ErrorBoundary';
import { routeResolver, getPalette } from '../App'; import { routeResolver, getPalette } from '../App';
@ -61,11 +62,13 @@ class SideMenu extends React.PureComponent {
<React.Fragment> <React.Fragment>
<ListDivider /> <ListDivider />
<ListSubheader>Journals</ListSubheader> <ListSubheader>Journals</ListSubheader>
<SideMenuJournals <ErrorBoundary>
etesync={this.props.etesync} <SideMenuJournals
journals={this.props.journals.value} etesync={this.props.etesync}
onItemClick={this.journalClicked} journals={this.props.journals.value}
/> onItemClick={this.journalClicked}
/>
</ErrorBoundary>
</React.Fragment> </React.Fragment>
); );

Loading…
Cancel
Save