better display of thrown errors

This commit is contained in:
Joey Hess 2011-07-05 14:58:33 -04:00
parent 82eb082ab9
commit d31b84c777
4 changed files with 15 additions and 5 deletions

View file

@ -43,14 +43,16 @@ showEndOk :: Annex ()
showEndOk = verbose $ liftIO $ putStrLn "ok"
showEndFail :: Annex ()
showEndFail = verbose $ liftIO $ putStrLn "\nfailed"
showEndFail = verbose $ liftIO $ putStrLn "failed"
showEndResult :: Bool -> Annex ()
showEndResult True = showEndOk
showEndResult False = showEndFail
showErr :: (Show a) => a -> Annex ()
showErr e = warning $ "git-annex: " ++ show e
showErr e = do
liftIO $ hFlush stdout
liftIO $ hPutStrLn stderr $ "git-annex: " ++ show e
warning :: String -> Annex ()
warning w = do