The app is now wired to GlitchTip with the Sentry SDKs
This commit is contained in:
30
frontend/src/app/[locale]/error.tsx
Normal file
30
frontend/src/app/[locale]/error.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
import { Button } from '@/components/ui/shared/Button';
|
||||
|
||||
export default function LocaleError({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
const t = useTranslations('common');
|
||||
|
||||
useEffect(() => {
|
||||
Sentry.captureException(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-[50vh] flex-col items-center justify-center gap-4 px-4 text-center">
|
||||
<h1 className="text-lg font-semibold">{t('pageErrorTitle')}</h1>
|
||||
<p className="max-w-md text-sm text-text-secondary">{t('pageErrorBody')}</p>
|
||||
<Button type="button" onClick={() => reset()}>
|
||||
{t('tryAgain')}
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user