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 ( -
-

Something went wrong!

-

- There was an internal server error, please see submit or view issues{" "} - here. -

-

Status details:

- - +
+
+
+ +
+ +

+ Something Went Wrong +

+ +

+ We encountered an error while fetching data for{" "} + {packageName} +

+ + + + Error: {error.message || "An unexpected error occurred"} + + + +
+
+

What you can try:

+
    +
  1. Refresh the page to try again
  2. +
  3. Clear your browser cache and cookies
  4. +
  5. Check your internet connection
  6. +
  7. If the error persists, please report it on GitHub
  8. +
+
+ +
+ + +
+ +

+ Error ID: {error.digest} +

+
+
); -} +} \ No newline at end of file diff --git a/app/projects/[project]/not-found.tsx b/app/projects/[project]/not-found.tsx index 21992fee..bef600a2 100644 --- a/app/projects/[project]/not-found.tsx +++ b/app/projects/[project]/not-found.tsx @@ -1,11 +1,60 @@ +"use client"; +import { Package, Search } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { useParams } from "next/navigation"; import Link from "next/link"; -export default function NotFound() { +export default function PackageNotFound() { + const params = useParams(); + const packageName = params?.project as string; + return ( -
-

Not Found

-

Could not find requested resource

- Return Home +
+
+
+ + +
+ +

+ Package Not Found +

+ +

+ 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:

+
    +
  • The package name is misspelled
  • +
  • The package is new and we don't have data
  • +
  • The package name uses different characters (e.g., underscore vs hyphen)
  • +
+
+ +
+ + +
+
+
); -} +} \ No newline at end of file