diff options
| author | Shulhan <m.shulhan@gmail.com> | 2019-08-29 00:11:24 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2019-08-29 00:11:24 +0700 |
| commit | 9e7e3ee2def1b6141143b5e4dc27a976f5ec779d (patch) | |
| tree | 9b4bd23a8bf41d4f301dd50e2ec171a94351e20d | |
| parent | 00fcc777782b9fce794f265e36156dc3d8b5c6f0 (diff) | |
| download | pakakeh.go-9e7e3ee2def1b6141143b5e4dc27a976f5ec779d.tar.xz | |
lib/io: log and ignore error from NewNode
An error for calling NewNode should not stop processing all files
in directory.
| -rw-r--r-- | lib/io/watcher.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/io/watcher.go b/lib/io/watcher.go index dc448f48..48c5a40e 100644 --- a/lib/io/watcher.go +++ b/lib/io/watcher.go @@ -60,7 +60,8 @@ func NewWatcher(path string, d time.Duration, cb WatchCallback) (w *Watcher, err node, err := memfs.NewNode(nil, fi, false) if err != nil { - return nil, fmt.Errorf("lib/io: NewWatcher: " + err.Error()) + log.Printf("lib/io: NewWatcher %s: %s", fi.Name(), err.Error()) + return nil, nil } if d < 100*time.Millisecond { |
