Better error handling #925
Closed
florian-lefebvre
started this conversation in
Proposal
Replies: 2 comments 11 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.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
Document
500.astroand 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.astropage 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.astro500.astropage 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.astroinstead of the dev overlay could be made possible using a flag, for example an environment variable or a new argument forastro devBeta Was this translation helpful? Give feedback.
All reactions