From 1f185f329bb82c87b250fb2312ae873d69a20d38 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 22 Mar 2025 13:59:00 +0800 Subject: Use a custom errPage500 --- http_error_page.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'http_error_page.go') diff --git a/http_error_page.go b/http_error_page.go index 77fdc86..0ddf055 100644 --- a/http_error_page.go +++ b/http_error_page.go @@ -23,3 +23,9 @@ func errorPage451(w http.ResponseWriter, params map[string]any, msg string) { params["complete_error_msg"] = msg _ = templates.ExecuteTemplate(w, "451", params) } + +func errorPage500(w http.ResponseWriter, params map[string]any, msg string) { + w.WriteHeader(http.StatusInternalServerError) + params["complete_error_msg"] = msg + _ = templates.ExecuteTemplate(w, "500", params) +} -- cgit v1.2.3