mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 08:41:37 +00:00
add global error handle
This commit is contained in:
@ -12,7 +12,7 @@ const page = () => {
|
||||
<>
|
||||
<AboutModel />
|
||||
|
||||
<main className="h-[calc(100vh-142px)] flex flex-col">
|
||||
<main className="h-[calc(100dvh-142px)] flex flex-col">
|
||||
<div
|
||||
className={clsx(
|
||||
'flex max-w-3xl',
|
||||
|
29
app/global-error.tsx
Normal file
29
app/global-error.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
import clsx from 'clsx';
|
||||
import Button from 'components/rua/button';
|
||||
|
||||
const GlobalError = ({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) => {
|
||||
return (
|
||||
<html>
|
||||
<body
|
||||
className={clsx('w-full h-dvh flex', 'justify-center items-center')}
|
||||
>
|
||||
<div>
|
||||
<h2 className="text-xl text-subtext1">
|
||||
Something went wrong! ノ( OωOノ)
|
||||
</h2>
|
||||
<Button onClick={() => reset()}>Try again</Button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
};
|
||||
|
||||
export default GlobalError;
|
@ -41,7 +41,7 @@ export default function RootLayout({
|
||||
</head>
|
||||
<body>
|
||||
<RUAThemeProvider>
|
||||
<div className="flex flex-col min-h-[100vh]">
|
||||
<div className="flex flex-col min-h-dvh">
|
||||
<HeadBar />
|
||||
{children}
|
||||
<Footer />
|
||||
|
Reference in New Issue
Block a user