summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-11 14:24:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-11 14:24:13 -0400
commitf7dbcd58ffb65258d914f1ecd6c0ff8f6bf2d3aa (patch)
tree6922c2442c6b8a8958bcf1251eb7322b2201d0a7 /Command
parent0847a300fc65a832171af53272439d18f6e9ed6b (diff)
tweak
Diffstat (limited to 'Command')
-rw-r--r--Command/Watch.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/Watch.hs b/Command/Watch.hs
index f01a9616f..76f03a097 100644
--- a/Command/Watch.hs
+++ b/Command/Watch.hs
@@ -142,11 +142,10 @@ runStateMVar mvar a = do
- Exceptions are ignored, otherwise a whole watcher thread could be crashed.
-}
runHandler :: MVar Annex.AnnexState -> ChangeChan -> Handler -> FilePath -> IO ()
-runHandler st changechan hook file = handle =<< tryIO (runStateMVar st go)
+runHandler st changechan handler file =
+ either (putStrLn . show) return =<< tryIO (runStateMVar st go)
where
- go = maybe noop (signalChange changechan) =<< hook file
- handle (Right ()) = return ()
- handle (Left e) = putStrLn $ show e
+ go = maybe noop (signalChange changechan) =<< handler file
{- Handlers call this when they made a change that needs to get committed. -}
madeChange :: FilePath -> String -> Annex (Maybe Change)