diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-22 13:59:00 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-22 13:59:00 +0800 |
commit | 1f185f329bb82c87b250fb2312ae873d69a20d38 (patch) | |
tree | 892ad487e7e1154fcb71fbe05acf9e583592e96b /http_error_page.go | |
parent | Variable name lengths (diff) | |
download | forge-1f185f329bb82c87b250fb2312ae873d69a20d38.tar.gz forge-1f185f329bb82c87b250fb2312ae873d69a20d38.tar.zst forge-1f185f329bb82c87b250fb2312ae873d69a20d38.zip |
Use a custom errPage500
Diffstat (limited to 'http_error_page.go')
-rw-r--r-- | http_error_page.go | 6 |
1 files changed, 6 insertions, 0 deletions
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) +} |