Added code to recover from a tiller pod crash in an event of template render failure

pull/3645/head
scriptonist 7 years ago
parent b372547a56
commit 6cfaa4ebf2

@ -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")

Loading…
Cancel
Save