Permalink
Browse files

hugolib: Make template panics into nice error messages

  • Loading branch information...
bep committed Jul 14, 2017
1 parent 91f410e commit 794ea21e9449b876c5514f1ce8fe61449bbe4980
Showing with 3 additions and 0 deletions.
  1. +3 −0 hugolib/site.go
View
@@ -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)

0 comments on commit 794ea21

Please sign in to comment.