/** * Root error boundary -- catch-all for all routes. * Catches unhandled errors from any page that doesn't have its own error.tsx. * Reports to GlitchTip when available, falls back to console logging. * Next.js requires a default export for error boundaries. * @see https://nextjs.org/docs/app/api-reference/file-conventions/error */ 'use client' import { useEffect } from 'react' import Link from 'next/link' import { WarningCircle, ArrowClockwise, House } from '@phosphor-icons/react' import { reportError } from '@/lib/error-reporting' export default function RootError({ error, reset, }: { error: Error & { digest?: string } reset: () => void }) { useEffect(() => { reportError(error, { boundary: 'root' }) }, [error]) const message = process.env.NODE_ENV === 'development' ? error.message : 'An unexpected error occurred. Please try again.' return ( <> Error | Barazo
) }