When fetching data inside of a Server Component, you can use the response to conditionally render an error message or redirect.
export default async function Page() { const res = await fetch(`https://...`) const data = await res.json() if (!res.ok) { return 'There was an error.' } return '...' } ![Motion Planning and Navigation — Ch.11: Legged Robot Navigation [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqftgs44jxvhe8fxlcrvt.png)