show fail message for template issues

This commit is contained in:
frosty 2024-09-06 06:52:44 -04:00
parent 170d4e3484
commit 4fb9dd34d6

View file

@ -73,12 +73,11 @@ func (m *Module) Run() {
tmpl, err := template.New("module").Parse(m.Template)
if err != nil {
log.Printf("template parsing error: %v\n", err)
return
output.WriteString("failed")
}
if err := tmpl.Execute(&output, info); err != nil {
log.Printf("template execution error: %v\n", err)
return
output.WriteString("failed")
}
} else {
fmt.Fprintf(&output, "%v", info)