Files
Frontend/src/app/global-error.tsx

24 lines
680 B
TypeScript
Raw Normal View History

2024-04-21 18:23:29 +01:00
"use client";
import * as Sentry from "@sentry/nextjs";
import Error from "next/error";
import { useEffect } from "react";
2024-04-22 02:41:42 +01:00
import Link from "next/link";
import { Button } from "@/app/components/ui/button";
2024-04-21 18:23:29 +01:00
export default function GlobalError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
return (
2024-04-22 02:41:42 +01:00
<div className="flex text-center flex-col gap-4">
<div>
<h2 className="text-red-400 font-2xl font-semibold">Error</h2>
<p>An error occurred while rendering this page.</p>
</div>
<Button onClick={reset}>Reload</Button>
</div>
2024-04-21 18:23:29 +01:00
);
}