From f7dbcd58ffb65258d914f1ecd6c0ff8f6bf2d3aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 Jun 2012 14:24:13 -0400 Subject: tweak --- Command/Watch.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Command') 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) -- cgit v1.2.3