import React, { Component, ErrorInfo, ReactElement, ReactNodeArray } from 'react' import { Button, Container } from 'react-bootstrap' import frontendVersion from '../../version.json' import { ForkAwesomeIcon } from '../common/fork-awesome/fork-awesome-icon' import { ExternalLink } from '../common/links/external-link' import links from '../../links.json' export class ErrorBoundary extends Component { state: { hasError: boolean } constructor (props: Readonly) { super(props) this.state = { hasError: false } } static getDerivedStateFromError (_error: Error): { hasError: boolean } { // Update state so the next render will show the fallback UI. return { hasError: true } } componentDidCatch (error: Error, errorInfo: ErrorInfo): void { console.error('error caught', error) console.error('additional information', errorInfo) } refreshPage (): void { window.location.reload() } render (): ReactElement | undefined | null | string | number | boolean | Record | ReactNodeArray { if (this.state.hasError) { return (

An unknown error occurred

Don't worry, this happens sometimes. If this is the first time you see this page then try reloading the app.

If you can reproduce this error, then we would be glad if you or
) } return this.props.children } }