aboutsummaryrefslogtreecommitdiff
path: root/git-annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-19 01:46:20 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-19 01:46:20 -0400
commit2caf711827470976f935bb06bb3b6b87e1776299 (patch)
treee2e3abec102b1c6f23234ef891b196f3b7f512e4 /git-annex.hs
parent470e0a2fbd1f554df677127212643d534c2f7857 (diff)
stop trapping all exceptions
Need to allow exceptions to be thrown for SIGPIPE propigation. Converted places that used error unncessarily to not.
Diffstat (limited to 'git-annex.hs')
-rw-r--r--git-annex.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-annex.hs b/git-annex.hs
index 947868f23..71a21379d 100644
--- a/git-annex.hs
+++ b/git-annex.hs
@@ -1,6 +1,6 @@
{- git-annex main program -}
-import Control.Exception
+import IO (try)
import System.IO
import System.Environment
@@ -18,8 +18,9 @@ main = do
(flags, actions) <- parseCmd args state
tryRun state $ [startup flags] ++ actions ++ [shutdown]
-{- Runs a list of Annex actions. Catches exceptions, not stopping
- - if some error out, and propigates an overall error status at the end.
+{- Runs a list of Annex actions. Catches IO errors and continues
+ - (but explicitly thrown errors terminate the whole command).
+ - Propigates an overall error status at the end.
-
- This runs in the IO monad, not in the Annex monad. It seems that
- exceptions can only be caught in the IO monad, not in a stacked monad;
@@ -29,8 +30,7 @@ main = do
tryRun :: AnnexState -> [Annex ()] -> IO ()
tryRun state actions = tryRun' state 0 actions
tryRun' state errnum (a:as) = do
- result <- try
- (Annex.run state a)::IO (Either SomeException ((), AnnexState))
+ result <- try $ Annex.run state a
case (result) of
Left err -> do
showErr err