Skip to content

Commit 9b42ef5

Browse files
butuzovandreynering
authored andcommitted
"file does not exist" improving for watchers
Adds additional (initial missing) context to the go generic `os.ErrNotExist` error, in addition to other errors that (possibly) can be returned by `zglob.Glob` Closes #472
1 parent 05ddfc0 commit 9b42ef5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

watch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package task
22

33
import (
44
"context"
5+
"fmt"
56
"os"
67
"os/signal"
78
"path/filepath"
@@ -129,7 +130,7 @@ func (e *Executor) registerWatchedFiles(w *watcher.Watcher, calls ...taskfile.Ca
129130
for _, s := range task.Sources {
130131
files, err := zglob.Glob(s)
131132
if err != nil {
132-
return err
133+
return fmt.Errorf("task: %s: %w", s, err)
133134
}
134135
for _, f := range files {
135136
absFile, err := filepath.Abs(f)

0 commit comments

Comments
 (0)