diff --git a/app/projects/[project]/error.tsx b/app/projects/[project]/error.tsx index e2881fa4..89bd538c 100644 --- a/app/projects/[project]/error.tsx +++ b/app/projects/[project]/error.tsx @@ -1,32 +1,86 @@ "use client"; +import { AlertTriangle, Github, RefreshCcw } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { Alert, AlertDescription } from "@/components/ui/alert"; import { useEffect } from "react"; -import { redirect } from "next/navigation"; +import { useParams } from "next/navigation"; -export default function Error({ - error, - reset, -}: { - error: Error; +interface ErrorProps { + error: Error & { digest?: string }; reset: () => void; -}) { +} + +export default function Error({ error, reset }: ErrorProps) { + const params = useParams(); + const packageName = params?.project as string; + useEffect(() => { - // Log the error to an error reporting service - console.error(error); + console.error("Package Error:", error); }, [error]); return ( -
- There was an internal server error, please see submit or view issues{" "} - here. -
-Status details:
-
+ We encountered an error while fetching data for{" "}
+ {packageName}
+
What you can try:
+
+ Error ID: {error.digest}
+
Could not find requested resource
- Return Home +
+ We couldn't find the Python package {packageName}
+
+ It might not exist on PyPI, or there could be a typo in the name. +
+ +Common reasons for this error:
+