aboutsummaryrefslogtreecommitdiffhomepage
path: root/watcher/filenotify
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2022-12-14 12:20:13 +0100
committerBjørn Erik Pedersen <[email protected]>2022-12-14 13:51:06 +0100
commitad2059878a8d6ace9669ccc5ff0a8d4e5811ad37 (patch)
tree34d88705ab22e5b54949a6ce48e028b1fc2ab7e6 /watcher/filenotify
parent87e898a17a52b5338bc9d554dd12b99a54aa2431 (diff)
downloadhugo-ad2059878a8d6ace9669ccc5ff0a8d4e5811ad37.tar.gz
hugo-ad2059878a8d6ace9669ccc5ff0a8d4e5811ad37.zip
Also consider wrapped errors when checking for file IsNotExist errors
Fixes #10534
Diffstat (limited to 'watcher/filenotify')
-rw-r--r--watcher/filenotify/poller.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/watcher/filenotify/poller.go b/watcher/filenotify/poller.go
index 71d806209..7479dcbdd 100644
--- a/watcher/filenotify/poller.go
+++ b/watcher/filenotify/poller.go
@@ -11,6 +11,7 @@ import (
"time"
"github.com/fsnotify/fsnotify"
+ "github.com/gohugoio/hugo/common/herrors"
)
var (
@@ -191,7 +192,7 @@ func (r *recording) record(filename string) error {
r.clear()
fi, err := os.Stat(filename)
- if err != nil && !os.IsNotExist(err) {
+ if err != nil && !herrors.IsNotExist(err) {
return err
}
@@ -206,7 +207,7 @@ func (r *recording) record(filename string) error {
if fi.IsDir() {
f, err := os.Open(filename)
if err != nil {
- if os.IsNotExist(err) {
+ if herrors.IsNotExist(err) {
return nil
}
return err
@@ -215,7 +216,7 @@ func (r *recording) record(filename string) error {
fis, err := f.Readdir(-1)
if err != nil {
- if os.IsNotExist(err) {
+ if herrors.IsNotExist(err) {
return nil
}
return err
@@ -260,7 +261,7 @@ func (item *itemToWatch) checkForChanges() ([]fsnotify.Event, error) {
}
err := item.right.record(item.filename)
- if err != nil && !os.IsNotExist(err) {
+ if err != nil && !herrors.IsNotExist(err) {
return nil, err
}