diff options
Diffstat (limited to 'Remote/Directory.hs')
-rw-r--r-- | Remote/Directory.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs index 8e306e228..6d3a5da7d 100644 --- a/Remote/Directory.hs +++ b/Remote/Directory.hs @@ -114,5 +114,9 @@ remove d k = liftIO $ catchBool $ do file = dirKey d k dir = parentDir file -checkPresent :: FilePath -> Key -> Annex (Either IOException Bool) -checkPresent d k = liftIO $ try $ doesFileExist (dirKey d k) +checkPresent :: FilePath -> Key -> Annex (Either String Bool) +checkPresent d k = dispatch <$> check + where + check = liftIO $ try $ doesFileExist (dirKey d k) + dispatch (Left e) = Left $ show e + dispatch (Right v) = Right v |