Files
formbricks-formbricks/apps/web/app/global-error.tsx
Dhruwang Jariwala ab80bc1bf2 feat: language switch (#2692)
Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
2024-06-12 14:10:22 +00:00

35 lines
871 B
TypeScript

"use client";
import * as Sentry from "@sentry/nextjs";
import Error from "next/error";
import { useEffect } from "react";
import { Button } from "@formbricks/ui/Button";
import { ErrorComponent } from "@formbricks/ui/ErrorComponent";
const GlobalError = ({ error, reset }: { error: Error; reset: () => void }) => {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
return (
<html>
<body>
<div className="flex h-full w-full flex-col items-center justify-center">
<ErrorComponent />
<Button
variant="secondary"
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
className="mt-2">
Try again
</Button>
</div>
</body>
</html>
);
};
export default GlobalError;