-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client' | ||
|
||
export default function Error({ | ||
error, | ||
reset, | ||
}: { | ||
error: Error & { | ||
digest?: string | ||
statusCode: number | ||
} | ||
reset: () => void | ||
}) { | ||
console.log('error render') | ||
|
||
return ( | ||
<main> | ||
<h1>Error</h1> | ||
<div id="random-number">Random: {Math.random()}</div> | ||
<p>{error.message}</p> | ||
<button onClick={reset}>Reset</button> | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use client' | ||
|
||
import { useState } from 'react' | ||
|
||
/** Add your relevant code here for the issue to reproduce */ | ||
export default function Page() { | ||
const [error, setError] = useState(false) | ||
if (error) { | ||
throw new Error('This is a test error') | ||
} | ||
return ( | ||
<> | ||
<button onClick={() => setError(true)}>Throw Error</button> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters