diff options
author | Eric Wong <e@80x24.org> | 2019-01-02 10:19:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-01-02 10:20:01 +0000 |
commit | 1df52e7304196386a6a84032aec1e8db3e0b83dd (patch) | |
tree | 2c8077f208de1a203e79dcb60fa6c035a634eccb /lib | |
parent | 4e51843e9491e97a6473b293812ceb2b2e7acf0f (diff) | |
download | dtas-1df52e7304196386a6a84032aec1e8db3e0b83dd.tar.gz |
Sometimes files become unreadable.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dtas/watchable.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/dtas/watchable.rb b/lib/dtas/watchable.rb index acaf0d5..7d2bac4 100644 --- a/lib/dtas/watchable.rb +++ b/lib/dtas/watchable.rb @@ -37,9 +37,13 @@ module DTAS::Watchable # :nodoc: @dir2wd = {} Array(paths).each do |path| watchdir, watchbase = File.split(File.expand_path(path)) - wd = @dir2wd[watchdir] ||= add_watch(watchdir, FLAGS) - m = @watches[wd] ||= {} - m[watchbase] = true + begin + wd = @dir2wd[watchdir] ||= add_watch(watchdir, FLAGS) + m = @watches[wd] ||= {} + m[watchbase] = true + rescue SystemCallError => e + warn "#{watchdir.dump}: #{e.message} (#{e.class})" + end end end end |