diff --git a/apps/website/src/app/error.tsx b/apps/website/src/app/error.tsx new file mode 100644 index 000000000..aeef6bf86 --- /dev/null +++ b/apps/website/src/app/error.tsx @@ -0,0 +1,87 @@ +'use client'; + +import { useEffect } from 'react'; +import { tokens } from '@ngaf/design-tokens'; +import { Container } from '../components/ui/Container'; +import { Section } from '../components/ui/Section'; +import { Eyebrow } from '../components/ui/Eyebrow'; +import { Button } from '../components/ui/Button'; + +interface ErrorBoundaryProps { + error: Error & { digest?: string }; + reset: () => void; +} + +/** + * App-router error boundary. Next.js renders this when a server or + * client component throws an uncaught error within this route segment. + * `reset` re-mounts the segment without a full reload. + */ +export default function ErrorBoundary({ error, reset }: ErrorBoundaryProps) { + useEffect(() => { + // Surface errors to whatever observability the app already wires up. + // Logging via console.error so it lands in browser devtools and any + // existing PostHog console-bridge or similar. + console.error('Unhandled error in app router:', error); + }, [error]); + + return ( +
+ +
+ Error +

+ Something went wrong. +

+

+ An unexpected error stopped this page from rendering. The team has been + notified. You can try again, or head back home. +

+ {error.digest ? ( +

+ Error ID: {error.digest} +

+ ) : ( +
+ )} +
+ + +
+
+ +
+ ); +} diff --git a/apps/website/src/app/not-found.tsx b/apps/website/src/app/not-found.tsx new file mode 100644 index 000000000..849f79bf0 --- /dev/null +++ b/apps/website/src/app/not-found.tsx @@ -0,0 +1,58 @@ +import { tokens } from '@ngaf/design-tokens'; +import { Container } from '../components/ui/Container'; +import { Section } from '../components/ui/Section'; +import { Eyebrow } from '../components/ui/Eyebrow'; +import { Button } from '../components/ui/Button'; + +export const metadata = { + title: 'Page not found — Angular Agent Framework', + description: 'The page you were looking for doesn’t exist.', +}; + +export default function NotFound() { + return ( +
+ +
+ 404 +

+ Page not found. +

+

+ The page you were looking for doesn't exist. It may have moved, or the link + you followed might be broken. +

+
+ + +
+
+
+
+ ); +}