Skip to content

Commit 6294bbb

Browse files
conico974Nicolas Dorseuil
and
Nicolas Dorseuil
authored
Fix error propagating (#3317)
Co-authored-by: Nicolas Dorseuil <[email protected]>
1 parent a28a997 commit 6294bbb

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.changeset/rotten-donuts-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook-v2": patch
3+
---
4+
5+
add a global error boundary
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use client';
2+
3+
import NextError from 'next/error';
4+
5+
export default function GlobalError({
6+
error,
7+
}: {
8+
error: Error & { digest?: string };
9+
}) {
10+
console.error('Global error:', error);
11+
return (
12+
<html lang="en">
13+
<body>
14+
<NextError statusCode={undefined as any} />
15+
</body>
16+
</html>
17+
);
18+
}

0 commit comments

Comments
 (0)