mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-04-30 18:59:37 +00:00
Small Updates
This commit is contained in:
parent
4de7d00340
commit
f7b2b16ab2
4 changed files with 207 additions and 31 deletions
27
app/global-error.tsx
Normal file
27
app/global-error.tsx
Normal file
|
@ -0,0 +1,27 @@
|
|||
'use client';
|
||||
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
import NextError from 'next/error';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
}) {
|
||||
useEffect(() => {
|
||||
Sentry.captureException(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<html>
|
||||
<body>
|
||||
{/* `NextError` is the default Next.js error page component. Its type
|
||||
definition requires a `statusCode` prop. However, since the App Router
|
||||
does not expose status codes for errors, we simply pass 0 to render a
|
||||
generic error message. */}
|
||||
<NextError statusCode={0} />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue