From: Bjørn Erik Pedersen Date: Mon, 2 Mar 2020 10:07:09 +0000 (+0100) Subject: hugolib: Fix error handling in page collector X-Git-Tag: v0.66.0~13 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3e9db2ad951dbb1000cd0f8f25e4a95445046679;p=brevno-suite%2Fhugo hugolib: Fix error handling in page collector Fixes #6988 --- diff --git a/hugolib/pages_capture.go b/hugolib/pages_capture.go index de7ccb08..020e243c 100644 --- a/hugolib/pages_capture.go +++ b/hugolib/pages_capture.go @@ -158,7 +158,10 @@ func (c *pagesCollector) isCascadingEdit(dir contentDirKey) (bool, string) { func (c *pagesCollector) Collect() (collectErr error) { c.proc.Start(context.Background()) defer func() { - collectErr = c.proc.Wait() + err := c.proc.Wait() + if collectErr == nil { + collectErr = err + } }() if len(c.filenames) == 0 {