2026-03-12 01:28:39 -07:00
|
|
|
"use client";
|
|
|
|
|
|
2026-03-26 16:19:43 +02:00
|
|
|
import "./globals.css";
|
2026-03-21 13:20:13 +05:30
|
|
|
import posthog from "posthog-js";
|
2026-03-12 01:28:39 -07:00
|
|
|
import { useEffect } from "react";
|
2026-03-26 16:19:43 +02:00
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
|
2026-03-12 01:28:39 -07:00
|
|
|
export default function GlobalError({
|
2026-03-27 03:17:05 -07:00
|
|
|
error,
|
|
|
|
|
reset,
|
2026-03-12 01:28:39 -07:00
|
|
|
}: {
|
2026-03-27 03:17:05 -07:00
|
|
|
error: Error & { digest?: string };
|
|
|
|
|
reset: () => void;
|
2026-03-12 01:28:39 -07:00
|
|
|
}) {
|
2026-03-27 03:17:05 -07:00
|
|
|
useEffect(() => {
|
|
|
|
|
posthog.captureException(error);
|
|
|
|
|
}, [error]);
|
2026-03-12 01:28:39 -07:00
|
|
|
|
2026-03-27 03:17:05 -07:00
|
|
|
return (
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<body>
|
|
|
|
|
<div className="flex min-h-screen flex-col items-center justify-center gap-4 p-4">
|
|
|
|
|
<h2 className="text-xl font-semibold">Something went wrong</h2>
|
|
|
|
|
<p className="text-sm text-muted-foreground">An unexpected error occurred.</p>
|
|
|
|
|
<Button onClick={reset}>Try again</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|
|
|
|
|
);
|
2026-03-12 01:28:39 -07:00
|
|
|
}
|