mirror of
https://codeberg.org/frosty/modbot.git
synced 2024-09-19 03:36:35 -04:00
show fail message for template issues
This commit is contained in:
parent
170d4e3484
commit
4fb9dd34d6
5
main.go
5
main.go
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue