fix: include actionable error details

This commit is contained in:
JetSprow
2026-04-29 15:03:00 +10:00
parent d7681240bb
commit df74723b52
28 changed files with 178 additions and 74 deletions

View File

@@ -2,6 +2,7 @@
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { getErrorMessage } from "@/lib/errors";
export default function AdminError({
error,
@@ -10,13 +11,18 @@ export default function AdminError({
error: Error & { digest?: string };
reset: () => void;
}) {
const message = getErrorMessage(error, "管理后台页面加载失败");
return (
<div className="flex items-center justify-center min-h-[60vh]">
<Card className="w-full max-w-md">
<CardContent className="py-10 text-center space-y-5">
<h1 className="text-xl font-semibold tracking-tight"></h1>
<p className="text-sm text-destructive">
{error.message || "页面加载失败,请稍后重试。"}
<p className="text-sm leading-6 text-destructive break-words">
{message}
</p>
<p className="text-xs leading-5 text-muted-foreground">
</p>
<Button onClick={reset} className="h-10"></Button>
</CardContent>