From dbeb9d071b346c3c27e7e144ab5853656bd89a7f Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Fri, 23 Nov 2018 15:33:16 +0000 Subject: [PATCH] Switch to just logging the error. Apparently, despite defining an error type, nothing exposes it. --- .../go-neb/services/alertmanager/alertmanager.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go b/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go index d6c6109..fc0e4da 100644 --- a/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go +++ b/src/github.com/matrix-org/go-neb/services/alertmanager/alertmanager.go @@ -129,10 +129,7 @@ func (s *Service) Register(oldService types.Service, client *gomatrix.Client) er // validate the plain text template is valid _, err := text.New("textTemplate").Parse(templates.TextTemplate) if err != nil { - log.WithFields(log.Fields{ - "line": err.line, - "description": err.description, - }).Warn("plain text Template Error") + log.WithError(err).Print("plain text Template Error") return fmt.Errorf("plain text template is invalid") } } @@ -140,10 +137,7 @@ func (s *Service) Register(oldService types.Service, client *gomatrix.Client) er // validate that the html template is valid _, err := html.New("htmlTemplate").Parse(templates.HTMLTemplate) if err != nil { - log.WithFields(log.Fields{ - "line": err.line, - "description": err.description, - }).Warn("HTML Template Error") + log.WithError(err).Print("html Template Error") return fmt.Errorf("html template is invalid") } }