Unverified Commit 1ccc9e8a authored by Mert Duzgun's avatar Mert Duzgun Committed by GitHub

docs: Add example code block to error handling docs (#67515)

Co-authored-by: 's avatarLee Robinson <me@leerob.io>
parent 0177545a
...@@ -109,7 +109,7 @@ You could also use the returned state to display a toast message from the client ...@@ -109,7 +109,7 @@ You could also use the returned state to display a toast message from the client
### Handling Expected Errors from Server Components ### Handling Expected Errors from Server Components
When fetching data inside of a Server Component, you can use the response to conditionally render an error message or `redirect`. When fetching data inside of a Server Component, you can use the response to conditionally render an error message or [`redirect`](/docs/app/building-your-application/routing/redirecting#redirect-function).
```tsx filename="app/page.tsx" switcher ```tsx filename="app/page.tsx" switcher
export default async function Page() { export default async function Page() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment