diff options
Diffstat (limited to 'http_template.go')
-rw-r--r-- | http_template.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/http_template.go b/http_template.go index e8520a9..82a1497 100644 --- a/http_template.go +++ b/http_template.go @@ -3,12 +3,17 @@ package main -import "net/http" +import ( + "net/http" + + "go.lindenii.runxiyu.org/lindenii-common/clog" +) // renderTemplate abstracts out the annoyances of reporting template rendering // errors. func renderTemplate(w http.ResponseWriter, templateName string, params map[string]any) { if err := templates.ExecuteTemplate(w, templateName, params); err != nil { - http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError) + http.Error(w, "error rendering template: "+err.Error(), http.StatusInternalServerError) + clog.Error(err.Error()) } } |