hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 794ea21e9449b876c5514f1ce8fe61449bbe4980
parent 91f410ea902fa32e042242f39c2e78f9cd6887ac
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Fri, 14 Jul 2017 10:08:04 +0200

hugolib: Make template panics into nice error messages

Diffstat:
Mhugolib/site.go | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -1967,6 +1967,9 @@ func (s *Site) renderAndWritePage(name string, dest string, p *PageOutput, layou
 }
 
 func (s *Site) renderForLayouts(name string, d interface{}, w io.Writer, layouts ...string) error {
+	defer func() {
+		recover()
+	}()
 	templ := s.findFirstTemplate(layouts...)
 	if templ == nil {
 		return fmt.Errorf("[%s] Unable to locate layout for %q: %s\n", s.Language.Lang, name, layouts)