Also consider wrapped errors when checking for file IsNotExist errors

Fixes #10534
This commit is contained in:
Bjørn Erik Pedersen
2022-12-14 12:20:13 +01:00
parent 87e898a17a
commit ad2059878a
21 changed files with 110 additions and 48 deletions

View File

@@ -15,9 +15,9 @@ package hugolib
import (
"io"
"os"
"path"
"github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/resources/page"
"github.com/hairyhenderson/go-codeowners"
@@ -32,7 +32,7 @@ func findCodeOwnersFile(dir string) (io.Reader, error) {
_, err := afs.Stat(f)
if err != nil {
if os.IsNotExist(err) {
if herrors.IsNotExist(err) {
continue
}
return nil, err