Better error handling #925
florian-lefebvre
started this conversation in
Proposal
Replies: 2 comments 2 replies
-
POC at withastro/astro#11134 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Were 401, 403, 4xx (400) pages discussed as well? I just tried to add a 403.astro page but it's not being picked up (with node adapter). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Document
500.astro
and allow retrieving the thrown error in it.Background & Motivation
Error handling is an important part of an SSR application. Things can go wrong and we don't want to show our users the scary default page of Vercel, Netlify etc.
The
500.astro
page had been requested in #610 and even though no answer has been given nor documentation added, this page is in fact supported. But it currently lacks the ability to retrieve the error and handle it properly (show some data, report etc).Goals
500.astro
500.astro
page in dev to test it properlyExample
We can take example on Nuxt and Next.js.
The error could be provided by props:
Using the
500.astro
instead of the dev overlay could be made possible using a flag, for example an environment variable or a new argument forastro dev
Beta Was this translation helpful? Give feedback.
All reactions