catch does not exist error when adding a watch
This could be thrown due to eg, the directory being moved or deleted, so the error should not be propigated.
This commit is contained in:
parent
40f310fe0b
commit
8b644e74fa
1 changed files with 4 additions and 2 deletions
|
@ -144,13 +144,15 @@ watchDir i dir ignored hooks
|
|||
_ -> noop
|
||||
filetype t f = catchBoolIO $ t <$> getSymbolicLinkStatus (indir f)
|
||||
|
||||
-- Inotify fails when there are too many watches with a
|
||||
-- disk full error.
|
||||
failedaddwatch e
|
||||
-- Inotify fails when there are too many watches with a
|
||||
-- disk full error.
|
||||
| isFullError e =
|
||||
case errHook hooks of
|
||||
Nothing -> throw e
|
||||
Just hook -> tooManyWatches hook dir
|
||||
-- The directory could have been deleted.
|
||||
| isDoesNotExistError e = return ()
|
||||
| otherwise = throw e
|
||||
|
||||
tooManyWatches :: (String -> Maybe FileStatus -> IO ()) -> FilePath -> IO ()
|
||||
|
|
Loading…
Add table
Reference in a new issue