diff --git a/src/main.coffee b/src/main.coffee index 7a1557e..a781d8e 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -40,7 +40,8 @@ class HandleWatcher extends EventEmitter @handle = binding.watch(@path) if handleWatchers.has(@handle) troubleWatcher = handleWatchers.get(@handle) - throw new Error("The handle(#{@handle}) returned by watching #{@path} is the same with an already watched path(#{troubleWatcher.path})") + troubleWatcher.close() + console.error("The handle(#{@handle}) returned by watching #{@path} is the same with an already watched path(#{troubleWatcher.path})") handleWatchers.add(@handle, this) closeIfNoListener: ->