mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-14 23:24:52 +09:00
Prevent the page from turning into a black screen when page rendering fails by adding an error boundary to the display of the page content in SiteLayout.jsx.
17 lines
425 B
React
17 lines
425 B
React
import React, { useContext } from "react";
|
|
import { Typography } from "antd";
|
|
|
|
import libLink from "@clusterio/lib/link";
|
|
|
|
import PageLayout from "./PageLayout";
|
|
|
|
const { Paragraph } = Typography;
|
|
|
|
|
|
export default function ErrorPage(props) {
|
|
return <PageLayout nav={[{ name: "Error" }]}>
|
|
<h2>An unexpected error occured</h2>
|
|
<Paragraph code className="error-traceback">{props.error.stack}</Paragraph>
|
|
</PageLayout>;
|
|
};
|