fix: add back global-error.tsx (#18692)
This commit is contained in:
1 parent
c581456586
commit
7897e14273
2 files changed
+21
-3
No files matched your search
@@ -12,12 +12,12 @@ import { ErrorPage } from "@components/error/error-page";
|
||||
|
||||
const log = logger.getSubLogger({ prefix: ["[error]"] });
|
||||
|
||||
type ErrorProps = {
|
||||
export type ErrorProps = {
|
||||
error: Error;
|
||||
reset: () => void;
|
||||
reset?: () => void;
|
||||
};
|
||||
|
||||
export default function Error({ error, reset }: ErrorProps) {
|
||||
export default function Error({ error }: ErrorProps) {
|
||||
React.useEffect(() => {
|
||||
log.error(error);
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
"use client";
|
||||
|
||||
import { type NextPage } from "next";
|
||||
|
||||
import CustomError from "./error";
|
||||
import type { ErrorProps } from "./error";
|
||||
|
||||
export const GlobalError: NextPage<ErrorProps> = (props) => {
|
||||
return (
|
||||
<html>
|
||||
<body>
|
||||
<CustomError {...props} />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
};
|
||||
|
||||
export default GlobalError;
|
||||
Reference in new issue
Block a user