From ddc8cc0082965143a650052a9aa538bac9133481 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Fri, 10 Mar 2017 15:45:07 -0600 Subject: [PATCH] hugolib: Clean up redundant frontmatter error logging Fixes #3157 --- hugolib/handler_base.go | 4 ++-- hugolib/page.go | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hugolib/handler_base.go b/hugolib/handler_base.go index 5b094fe1..89aadd11 100644 --- a/hugolib/handler_base.go +++ b/hugolib/handler_base.go @@ -42,10 +42,10 @@ type HandledResult struct { func (h HandledResult) Error() string { if h.err != nil { if h.page != nil { - return "Error:" + h.err.Error() + " for " + h.page.File.LogicalName() + return "Error: " + h.err.Error() + " for " + h.page.File.LogicalName() } if h.file != nil { - return "Error:" + h.err.Error() + " for " + h.file.LogicalName() + return "Error: " + h.err.Error() + " for " + h.file.LogicalName() } } return h.err.Error() diff --git a/hugolib/page.go b/hugolib/page.go index dcfffa66..02f889d9 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -1394,9 +1394,7 @@ func (p *Page) parse(reader io.Reader) error { meta, err := psr.Metadata() if meta != nil { if err != nil { - p.s.Log.ERROR.Printf("Error parsing page meta data for %s", p.File.Path()) - p.s.Log.ERROR.Println(err) - return err + return fmt.Errorf("failed to parse page metadata for %s: %s", p.File.Path(), err) } if err = p.update(meta); err != nil { return err -- 2.30.2