File tree Expand file tree Collapse file tree 4 files changed +34
-38
lines changed
Expand file tree Collapse file tree 4 files changed +34
-38
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useEffect } from "react" ;
4- import { ErrorPage } from "@/components/error-page" ;
5- import { Button } from "@/components/ui/button" ;
3+ import { RuntimeError } from "@/components/error-page" ;
64
75interface ErrorProps {
86 error : Error & { digest ?: string } ;
97 reset : ( ) => void ;
108}
119
1210export default function CatalogErrorPage ( { error, reset } : ErrorProps ) {
13- useEffect ( ( ) => {
14- console . error ( error ) ;
15- } , [ error ] ) ;
16-
17- return (
18- < ErrorPage
19- title = "Something went wrong"
20- actions = {
21- < Button onClick = { reset } variant = "default" >
22- Try again
23- </ Button >
24- }
25- >
26- An unexpected error occurred. Please try again.
27- </ ErrorPage >
28- ) ;
11+ return < RuntimeError error = { error } reset = { reset } /> ;
2912}
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useEffect } from "react" ;
4- import { ErrorPage } from "@/components/error-page" ;
5- import { Button } from "@/components/ui/button" ;
3+ import { RuntimeError } from "@/components/error-page" ;
64
75interface ErrorProps {
86 error : Error & { digest ?: string } ;
97 reset : ( ) => void ;
108}
119
1210export default function RootErrorPage ( { error, reset } : ErrorProps ) {
13- useEffect ( ( ) => {
14- console . error ( error ) ;
15- } , [ error ] ) ;
16-
17- return (
18- < ErrorPage
19- title = "Something went wrong"
20- actions = {
21- < Button onClick = { reset } variant = "default" >
22- Try again
23- </ Button >
24- }
25- >
26- An unexpected error occurred. Please try again.
27- </ ErrorPage >
28- ) ;
11+ return < RuntimeError error = { error } reset = { reset } /> ;
2912}
Original file line number Diff line number Diff line change 11export { ErrorPage } from "./error-page" ;
2+ export { RuntimeError } from "./runtime-error" ;
Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import { useEffect } from "react" ;
4+ import { Button } from "@/components/ui/button" ;
5+ import { ErrorPage } from "./error-page" ;
6+
7+ interface RuntimeErrorProps {
8+ error : Error & { digest ?: string } ;
9+ reset : ( ) => void ;
10+ }
11+
12+ export function RuntimeError ( { error, reset } : RuntimeErrorProps ) {
13+ useEffect ( ( ) => {
14+ console . error ( error ) ;
15+ } , [ error ] ) ;
16+
17+ return (
18+ < ErrorPage
19+ title = "Something went wrong"
20+ actions = {
21+ < Button onClick = { reset } variant = "default" >
22+ Try again
23+ </ Button >
24+ }
25+ >
26+ An unexpected error occurred. Please try again.
27+ </ ErrorPage >
28+ ) ;
29+ }
You can’t perform that action at this time.
0 commit comments