-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[✨] Centralized custom error pages #2285
Comments
Related #2175 |
@nnelgxorz yep, it seems that #2175 is what we expect to have. |
Looks like that PR should already be in the latest release. I haven't tried it myself yet. |
Hi @Nefcanto |
@zanettin, will test it and reply back. Thank you for following up. |
Hi @Nefcanto 👋 |
@zanettin you're such a gentleman to follow up. I'm sorry for forgetting this. Today I tested it and it did not work. I created a page called I'm using Qwik version Again, sorry that I forgot. |
Thanks a lot for your test @Nefcanto and the kind words 🙏 and sorry for the inconvenience and misleading answer from my side. i've checked it on my end with the same result. maybe @adamdbradley can give us a hand/hint on how it should work? |
I'm curious why this is logged in the Post V1 backlog. This seems like a very important functionality and something that should be decided upon before V1. |
I close this issue because the function is in the framework. There is a specific issue for 404 problem #5030 and I think we should open new issues and not continue in this old thread. |
Is your feature request related to a problem?
A typical website might have these modules:
The way docs says, for now, we need to check for response status code on each page, and if it's 404, return a 404 response, and if it's 500, return a 500 response, etc.
This is hugely cumbersome and extremely inefficient.
Almost all web frameworks have a centralized way to return 404 or 500 or other custom pages related to the status code of the HTTP response.
For example, Next.js or ASP.NET Core let you create a page called
404.js
or404.cshtml
and centralize your UI there.Describe the solution you'd like
Right now, I'm thinking of higher-order components to centralize my response logic for 404 and 500, and 410 responses.
However, this means that everywhere I should use
withNotFound(withError(withGone(MyComponent)))
which is extremely inefficient, ugly, and hard to maintain.Describe alternatives you've considered
If in
onGet
oronPost
or otheronX
methods we returned any code other than 200, then let us create a page by that status code and serve that page instead.Additional context
No response
The text was updated successfully, but these errors were encountered: