better error messages for template errors
authorspf13 <steve.francia@gmail.com>
Thu, 2 Oct 2014 17:37:38 +0000 (13:37 -0400)
committerspf13 <steve.francia@gmail.com>
Thu, 2 Oct 2014 17:37:38 +0000 (13:37 -0400)
hugolib/template.go

index d2cfccf3d6286e2d9f213fb1a2e23a2b144a28ec..0b7f5e7d023dd5424db29efff216add4ece07cd4 100644 (file)
@@ -434,7 +434,10 @@ func ExecuteTemplate(context interface{}, layouts ...string) *bytes.Buffer {
        worked := false
        for _, layout := range layouts {
                if localTemplates.Lookup(layout) != nil {
-                       localTemplates.ExecuteTemplate(buffer, layout, context)
+                       err := localTemplates.ExecuteTemplate(buffer, layout, context)
+                       if err != nil {
+                               jww.ERROR.Println(err, "in", layout)
+                       }
                        worked = true
                        break
                }