From 4ce5ad6a00f060bf2a75b92be816ca5ff3acef92 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 19 May 2021 21:15:46 -0600 Subject: [PATCH] handle the template execution error --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index a23026e..2d8aa08 100644 --- a/main.go +++ b/main.go @@ -252,6 +252,10 @@ func main() { l.User = user } err = templ.ExecuteTemplate(w, "landing", l) + if err != nil { + log.Println(err) + http.Error(w, err.Error(), http.StatusInternalServerError) + } } } }))