about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/dtas/watchable.rb10
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