Add custom error page for client-side exceptions
This commit is contained in:
parent
93fa003f72
commit
c5b54f627c
12
app/global-error.tsx
Normal file
12
app/global-error.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
@ -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}
|
||||
|
||||
@ -8,7 +8,7 @@ export default function HttpStatusPage({
|
||||
status,
|
||||
children,
|
||||
}: {
|
||||
status: number
|
||||
status: ReactNode
|
||||
children?: ReactNode
|
||||
}) {
|
||||
return (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user