Handle incoming errors from the walking calls

Fix #7
This commit is contained in:
Max Claus Nunes 2018-10-21 09:46:22 -03:00
parent 612540b1b3
commit c9da986360
1 changed files with 4 additions and 0 deletions

View File

@ -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)
}