diff options
Diffstat (limited to 'Annex/Exception.hs')
-rw-r--r-- | Annex/Exception.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Annex/Exception.hs b/Annex/Exception.hs index 040229d65..aaa6811a5 100644 --- a/Annex/Exception.hs +++ b/Annex/Exception.hs @@ -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 |