Skip to content

Commit

Permalink
Update custom-error-page for getServerSideProps (#41723)
Browse files Browse the repository at this point in the history
`fetch` output type has `status` but no `statusCode`, see MDN https://developer.mozilla.org/en-US/docs/Web/API/Response/status


## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
  • Loading branch information
HugoDF committed Oct 24, 2022
1 parent 8935529 commit fedcae4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/advanced-features/custom-error-page.md
Expand Up @@ -74,7 +74,7 @@ import Error from 'next/error'

export async function getServerSideProps() {
const res = await fetch('https://api.github.com/repos/vercel/next.js')
const errorCode = res.ok ? false : res.statusCode
const errorCode = res.ok ? false : res.status
const json = await res.json()

return {
Expand Down

0 comments on commit fedcae4

Please sign in to comment.