Add Error Boundary for Pages

This commit is contained in:
Mohamed Karray
2019-03-13 11:54:33 +01:00
parent 1b9892e577
commit 35c84c929a
2 changed files with 42 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ import Subtitle from "./Subtitle";
import injectSheet from "react-jss";
import classNames from "classnames";
import PageActions from "./PageActions";
import PageErrorBoundary from "../errorboundary/PageErrorBoundary";
type Props = {
title?: string,
@@ -31,13 +32,15 @@ class Page extends React.Component<Props> {
render() {
const { error } = this.props;
return (
<section className="section">
<div className="container">
{this.renderPageHeader()}
<ErrorNotification error={error} />
{this.renderContent()}
</div>
</section>
<PageErrorBoundary>
<section className="section">
<div className="container">
{this.renderPageHeader()}
<ErrorNotification error={error} />
{this.renderContent()}
</div>
</section>
</PageErrorBoundary>
);
}