Skip to content

Commit

Permalink
fix: add some logging if html template doesn't execute
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsgruk committed Aug 9, 2024
1 parent 631bac6 commit 4666ecd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ func libationsMux(drinks []Drink, files fs.FS, templates *template.Template) *ht
Time: time.Now().Format("January 2, 2006 at 15:04 MST"),
Drinks: drinks,
}
templates.Lookup("index.html").Execute(w, data)

err := templates.Lookup("index.html").Execute(w, data)
if err != nil {
slog.Error("failed to execute template", "template", "index.html")
}
})

return mux
Expand Down

0 comments on commit 4666ecd

Please sign in to comment.