Hi Hashnoders :)
So I was looking at this list of HTTP error codes (4xx-5xx).
Currently if any visitors land on a 404 Page Not Found or 500 Internal Error page, I redirect them to a 'pretty page' which also e-mails me an alert that users are landing on error pages, but would it be viable to redirect visitors that land on Any error (from 4xx to 5xx, which is about 39 error codes in total) ?
Reason I ask is cause, well, I have no idea how/why networking/http requests work the way they do, and nobody would want to 'break' anything by dumping these pretty pages to the users without considering the big picture.
Marco Alka
Software Engineer, Technical Consultant & Mentor
I don't see any reason as to why you should not redirect visitors to a pretty page for any error.
From your perspective, if you don't know the error code, chances are that you can't even do a lot about them, because they probably don't come from your own code.
From a visitor's perspective, they don't care about what went wrong. What are these error codes anyway? They just want to use the website. So whatever went wrong, try to tell them in a simple way and smooth over it. They don't care, so why should you make them?
Ideally handle the error under the hood, but that needs a deeper understanding of your application and stack 😉