๐Ÿ“ฆ cloudflare / vinext

๐Ÿ“„ global-error.tsx ยท 26 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26"use client";

/**
 * Global error boundary for testing server-only violation errors.
 * The E2E test checks for the "global-error-message" test ID.
 */
export default function GlobalError({
  error,
  reset,
}: {
  error: Error;
  reset: () => void;
}) {
  return (
    <html>
      <body>
        <div data-testid="global-error">
          <h1>Something went wrong!</h1>
          <p data-testid="global-error-message">{error.message}</p>
          <button onClick={reset}>Try again</button>
        </div>
      </body>
    </html>
  );
}