diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 46e0a59cf..e83476eae 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -19,6 +19,7 @@ package engine import ( "bytes" "fmt" + "log" "path" "sort" "strings" @@ -204,6 +205,11 @@ func (e *Engine) render(tpls map[string]renderable) (map[string]string, error) { // The idea with this process is to make it possible for more complex templates // to share common blocks, but to make the entire thing feel like a file-based // template engine. + defer func() { + if err := recover(); err != nil { + log.Printf("rendering template failed: %v\n", err) + } + }() t := template.New("gotpl") if e.Strict { t.Option("missingkey=error")