Add custom error page for client-side exceptions

This commit is contained in:
Sam Becker 2025-04-17 09:30:55 -05:00
parent 93fa003f72
commit c5b54f627c
3 changed files with 14 additions and 2 deletions

12
app/global-error.tsx Normal file
View File

@ -0,0 +1,12 @@
'use client';
import HttpStatusPage from '@/components/HttpStatusPage';
import { TbRefresh } from 'react-icons/tb';
export default function GlobalError() {
return (
<HttpStatusPage status={<TbRefresh />}>
Something went wrong
</HttpStatusPage>
);
}

View File

@ -10,7 +10,7 @@ export default function NotFound() {
return (
<HttpStatusPage status={404}>
<span className={clsx(
'underline underline-offset-2 decoration-dotted',
'underline underline-offset-4 decoration-dotted',
'cursor-not-allowed',
)}>
{pathname}

View File

@ -8,7 +8,7 @@ export default function HttpStatusPage({
status,
children,
}: {
status: number
status: ReactNode
children?: ReactNode
}) {
return (