This commit is contained in:
2026-03-25 14:59:06 +08:00
commit ae315100b4
92 changed files with 9285 additions and 0 deletions

44
src/pages/Error/index.tsx Normal file
View File

@@ -0,0 +1,44 @@
import {
useRouteError,
type ErrorResponse,
isRouteErrorResponse,
} from "react-router";
export function ErrorPage() {
const error = useRouteError();
if (isRouteErrorResponse(error)) {
const statusError = error as ErrorResponse;
if (statusError.status == 404) {
return (
<div>
<h1></h1>
</div>
);
} else {
return (
<div>
<h1></h1>
<h3>{statusError.status}</h3>
<h3>{statusError.statusText}</h3>
<h3>{JSON.stringify(statusError.data)}</h3>
</div>
);
}
} else if (error instanceof Error) {
const err = error as Error;
return (
<div>
<h1></h1>
<h3>{err.name}</h3>
<h3>{err.message}</h3>
</div>
);
} else {
return (
<div>
<h1></h1>
</div>
);
}
}