indirect: Better behavior when a file in direct mode is not owned by the user running the conversion.

This commit is contained in:
Joey Hess 2013-09-25 15:29:56 -04:00
parent c923c981b9
commit c45f5fbdb3
4 changed files with 30 additions and 4 deletions

View file

@ -13,6 +13,7 @@
module Annex.Exception (
bracketIO,
tryAnnex,
tryAnnexIO,
throwAnnex,
catchAnnex,
) where
@ -30,6 +31,10 @@ bracketIO setup cleanup = M.bracket (liftIO setup) (liftIO . cleanup)
tryAnnex :: Annex a -> Annex (Either SomeException a)
tryAnnex = M.try
{- try in the Annex monad, but only catching IO exceptions -}
tryAnnexIO :: Annex a -> Annex (Either IOException a)
tryAnnexIO = M.try
{- throw in the Annex monad -}
throwAnnex :: Exception e => e -> Annex a
throwAnnex = M.throw