From c9da9863607f332c79b73c41b6d5d61a0a167684 Mon Sep 17 00:00:00 2001 From: Max Claus Nunes Date: Sun, 21 Oct 2018 09:46:22 -0300 Subject: [PATCH] Handle incoming errors from the walking calls Fix #7 --- watcher.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/watcher.go b/watcher.go index 738e84d..5abbf6d 100644 --- a/watcher.go +++ b/watcher.go @@ -117,6 +117,10 @@ func (w *watcher) scanChange(watchPath string) (string, error) { var fileChanged string err := filepath.Walk(watchPath, func(path string, info os.FileInfo, err error) error { + if err != nil { + return fmt.Errorf("couldn't walk to path \"%s\": %v", path, err) + } + if w.ignoreFile(path, info) { return skipFile(info) }