From fe234f41fb49eb0f50ff53cee05082ff0c6a0879 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 29 Feb 2024 20:05:50 +0800 Subject: [PATCH] chore: global error Signed-off-by: Innei --- src/app/global-error.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx index 1f10395854..d6b007875c 100644 --- a/src/app/global-error.tsx +++ b/src/app/global-error.tsx @@ -8,7 +8,13 @@ import { domAnimation, LazyMotion } from 'framer-motion' import { NormalContainer } from '~/components/layout/container/Normal' import { StyledButton } from '~/components/ui/button' -export default function Error({ error }: any) { +export default function GlobalError({ + error, + reset, +}: { + error: Error & { digest?: string } + reset: () => void +}) { useEffect(() => { console.log(error) // captureException(error) @@ -16,14 +22,16 @@ export default function Error({ error }: any) { return ( - 出错啦 + 禁止访问或者 API 服务出现问题 -

{error?.message || '未知错误'}

- - 重试 - +

禁止访问或者 API 服务出现问题

+
+ + 重试 + +