sanity
sanity copied to clipboard
Best practice way to handle and redirect 50X and 404 errors when querying sanity fetch
Hey Nuxt Sanity team! I am looking for advice on error handling: When I query a page entry using the slug, I will need a way to do the following:
- Redirect to the nuxt
404error page if the query returns empty - Redirect and render the appropriate error when the query returns a
50Xerror
I am new to this module and I am not sure how best to do this. Can anyone share their method for doing so?
I am using Nuxt 3.0.0-rc.11 and Nuxt/sanity ^1.3.0