fix(app): add friendly not-found handling

This commit is contained in:
Gabriel Brown
2026-07-10 17:24:32 -04:00
parent c4d0f5219a
commit ed21126eea
7 changed files with 203 additions and 5 deletions
+30
View File
@@ -0,0 +1,30 @@
'use client';
import { useEffect } from 'react';
import * as Sentry from '@sentry/nextjs';
import { Button } from '@spoon/ui';
const AppError = ({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) => {
useEffect(() => {
Sentry.captureException(error);
}, [error]);
return (
<main className='flex min-h-[50vh] flex-col items-center justify-center gap-4 p-6 text-center'>
<h1 className='text-2xl font-semibold'>Something went wrong</h1>
<p className='text-muted-foreground max-w-md text-sm'>
This page hit an unexpected error. It has been reported.
</p>
<Button onClick={() => reset()}>Try again</Button>
</main>
);
};
export default AppError;