import React from 'react'; import ErrorNotification from './ErrorNotification'; import { BackendError, ForbiddenError } from './errors'; type Props = { error: Error; title: string; subtitle: string; }; class ErrorPage extends React.Component { render() { const { title, error } = this.props; return (

{title}

{this.renderSubtitle()}
); } renderSubtitle = () => { const { error, subtitle } = this.props; if (error instanceof BackendError || error instanceof ForbiddenError) { return null; } return

{subtitle}

; }; } export default ErrorPage;