-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs for handing error pages are not ideal #6420
Comments
Thanks for reporting this @ctolkien ! 💪 Much appreciated! Now, this might be a stupid question, so please forgive me, but isn't it in most cases better for the user to not see the error, than for them to see it? 😅 In any case, would you be up for suggestion a rewrite of this guide, to include your suggestions? |
Yep, to be clear, the issue is not the content that is shown. It is that the current flow is:
When a user hits an error, ideally the URL does not change, they should get the error on the same URL they are on, showing the error content, but at the current URL with a 500 status code.
Yes, let me do a bit more digging on handling the use cases. There are some further considerations, for instance you ideally want to have the 500 page be static content and not be rendered via the CMS. If there is an issue in your Layout file (for instance), which means that no page can work - including the 500 page, then your user will not see the properly rendered 500 page. By having it be as simple as possible, with no dependencies, that would be the most reliable option. |
Aha, yes, I see what you mean 🤔 It would be great if you could suggest a better method here! Hacktoberfest starts next month, and this sounds like a perfect little side task for that 😄 |
What type of issue is it? (Choose one - delete the others)
Wrong documentation
What article/section is this about?
(link here)
Describe the issue
This section describes intercepting the 500 error response and then redirecting the user to a page to display the error. In this scenario statuscode is lost, and the user never actually receives a 500 error, they end up receiving a 3XX redirection.
This should probably be using some combination of
app.UseExceptionHandler("...");
andapp.UseStatusCodePagesWithReExecute("/error/{0}");
The text was updated successfully, but these errors were encountered: