IO exception rework

ghc 7.4 comaplains about use of System.IO.Error to catch exceptions.
Ok, use Control.Exception, with variants specialized to only catch IO
exceptions.
This commit is contained in:
Joey Hess 2012-02-03 16:47:24 -04:00
parent 05f89123e0
commit 146c36ca54
14 changed files with 56 additions and 44 deletions

View file

@ -7,8 +7,6 @@
module Upgrade.V0 where
import System.IO.Error (try)
import Common.Annex
import Annex.Content
import qualified Upgrade.V1
@ -47,7 +45,7 @@ getKeysPresent0 dir = do
return $ map fileKey0 files
where
present d = do
result <- try $
result <- tryIO $
getFileStatus $ dir ++ "/" ++ takeFileName d
case result of
Right s -> return $ isRegularFile s

View file

@ -7,7 +7,6 @@
module Upgrade.V1 where
import System.IO.Error (try)
import System.Posix.Types
import Data.Char
@ -183,7 +182,7 @@ readLog1 file = catchDefaultIO (parseLog <$> readFileStrict file) []
lookupFile1 :: FilePath -> Annex (Maybe (Key, Backend))
lookupFile1 file = do
tl <- liftIO $ try getsymlink
tl <- liftIO $ tryIO getsymlink
case tl of
Left _ -> return Nothing
Right l -> makekey l
@ -216,7 +215,7 @@ getKeyFilesPresent1' dir = do
liftIO $ filterM present files
where
present f = do
result <- try $ getFileStatus f
result <- tryIO $ getFileStatus f
case result of
Right s -> return $ isRegularFile s
Left _ -> return False