hugolib: Improve error handling in refLink
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 19 Jul 2018 15:17:35 +0000 (17:17 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 19 Jul 2018 15:17:35 +0000 (17:17 +0200)
hugolib/site.go

index b460a0f8105b0c094e689e54bf5e3821834ca9a6..dcb9b1d8c612e3961c4d3610bb65ac8d1ca41a85 100644 (file)
@@ -514,7 +514,8 @@ func (s *siteRefLinker) refLink(ref string, page *Page, relative bool, outputFor
                target, err := s.s.getPageNew(page, refURL.Path)
 
                if err != nil {
-                       return "", err
+                       s.logNotFound(refURL.Path, err.Error(), page)
+                       return s.notFoundURL, nil
                }
 
                if target == nil {