From bef866faae2b699dbbb4cfc3ec18adcbaed27b8b Mon Sep 17 00:00:00 2001 From: Bastian Greshake Tzovaras Date: Tue, 5 Nov 2024 21:01:13 +0000 Subject: [PATCH] Improve error message when pages don't work (#398) On Matrix there was a recent discussion about the quality of the error page that _Codeberg Pages_ displays. Pixelcode had posted this relevant points: > Currently, the message reads as if written for the website's owner. I think it should be rephrased so that visitors who encounter the error understand that: > 1. This page is an error message, not the actual website. (e.g. Error 424 instead of just 424) > 2. The website is hosted on Codeberg Pages, not on a server controlled by the owner. > 3. There's perhaps a configuration error or an internal server issue. > 4. It might take a little until the website is up again. In particular the point about the "dual audience" of _Codeberg Pages_ user/website owner and website visitor seems important, to make sure that both audiences understand that there's an error. Also the error can be due to _Codeberg Pages_ being down or due to the user misconfiguring their page. I've taken a first stab at trying to cover those 4 points, but of course the exact improvements are up for debate, but thought it would be easiest to provide a concrete suggestion to get us started! Co-authored-by: crapStone Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/398 Co-authored-by: Bastian Greshake Tzovaras Co-committed-by: Bastian Greshake Tzovaras --- html/templates/error.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/html/templates/error.html b/html/templates/error.html index 05a5d46..ccaa682 100644 --- a/html/templates/error.html +++ b/html/templates/error.html @@ -33,12 +33,17 @@ d="M 9 2 C 5.1458514 2 2 5.1458514 2 9 C 2 12.854149 5.1458514 16 9 16 C 10.747998 16 12.345009 15.348024 13.574219 14.28125 L 14 14.707031 L 14 16 L 19.585938 21.585938 C 20.137937 22.137937 21.033938 22.137938 21.585938 21.585938 C 22.137938 21.033938 22.137938 20.137938 21.585938 19.585938 L 16 14 L 14.707031 14 L 14.28125 13.574219 C 15.348024 12.345009 16 10.747998 16 9 C 16 5.1458514 12.854149 2 9 2 z M 9 4 C 11.773268 4 14 6.2267316 14 9 C 14 11.773268 11.773268 14 9 14 C 6.2267316 14 4 11.773268 4 9 C 4 6.2267316 6.2267316 4 9 4 z" /> -

{{.StatusText}} ({{.StatusCode}})!

+

{{.StatusText}} (Error {{.StatusCode}})!

-

Sorry, but this page couldn't be served.

+

Sorry, but this page couldn't be served:

"{{.Message}}"

- We hope this isn't a problem on our end ;) - Make sure to check the + The page you tried to reach is hosted on Codeberg Pages, which might currently be experiencing technical + difficulties. If that is the case, it could take a little while until this page is available again. +

+

+ Otherwise, this page might also be unavailable due to a configuration error. If you are the owner of this + website, please make sure to check the troubleshooting section in the Docs!