From 0b62b1cdd829e74cc0a2b145e883611cb3356c22 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 1 Oct 2018 15:07:52 +0200 Subject: [PATCH] Add error logging for http rendering errors Signed-off-by: Knut Ahlers --- http.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/http.go b/http.go index 2f70d34..6eef63a 100644 --- a/http.go +++ b/http.go @@ -18,12 +18,14 @@ func htmlHandler(res http.ResponseWriter, r *http.Request) { log.Fatal(err) } - template.ExecuteWriter(pongo2.Context{ + if err := template.ExecuteWriter(pongo2.Context{ "results": probeMonitors, "certificateOK": certificateOK, "certificateExpiresSoon": certificateExpiresSoon, "version": version, - }, res) + }, res); err != nil { + log.WithError(err).Error("Unable to render display template") + } } func httpStatusHandler(res http.ResponseWriter, r *http.Request) {