summaryrefslogtreecommitdiff
path: root/Annex/Exception.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-25 15:29:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-25 15:29:56 -0400
commita286ee114b76db22054a71987508d7de834cba63 (patch)
tree0b28eda73e7df3958bfd2570a52bb255e25f7b7e /Annex/Exception.hs
parentd2b503f7edb486f31545633fc7c7b4a9999a271e (diff)
indirect: Better behavior when a file in direct mode is not owned by the user running the conversion.
Diffstat (limited to 'Annex/Exception.hs')
-rw-r--r--Annex/Exception.hs5
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