summaryrefslogtreecommitdiff
path: root/git-annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-11 18:39:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-11 18:39:09 -0400
commit530f16b980bbfe70b49d5112ad9c48a9754e69c5 (patch)
tree035c3d72addea00aa78629af01b8ce02b07a3df5 /git-annex.hs
parent8f99409518d343ded6a1355b4366bd21ee4cf66d (diff)
better result summary
Diffstat (limited to 'git-annex.hs')
-rw-r--r--git-annex.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/git-annex.hs b/git-annex.hs
index 22fbe60ca..ec80359b6 100644
--- a/git-annex.hs
+++ b/git-annex.hs
@@ -13,21 +13,21 @@ main = do
state <- startAnnex
- tryRun 0 $ map (\f -> dispatch state mode f) files
+ tryRun 0 0 $ map (\f -> dispatch state mode f) files
{- Tries to run a series of actions, not stopping if some error out,
- and propigating an overall error status at the end. -}
-tryRun errflag [] = do
- if (errflag > 0)
- then error "unsuccessful"
+tryRun errnum oknum [] = do
+ if (errnum > 0)
+ then error $ (show errnum) ++ " failed ; " ++ show (oknum) ++ " succeeded"
else return ()
-tryRun errflag (a:as) = do
+tryRun errnum oknum (a:as) = do
result <- try (a)::IO (Either SomeException ())
case (result) of
Left err -> do
showErr err
- tryRun 1 as
- Right _ -> tryRun errflag as
+ tryRun (errnum + 1) oknum as
+ Right _ -> tryRun errnum (oknum + 1) as
{- Exception pretty-printing. -}
showErr :: SomeException -> IO ()