diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-26 23:01:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-26 23:01:44 -0400 |
commit | 0950b8314a21e125aec383db078afc648bd4444e (patch) | |
tree | 59a37c2d90e73dfcbcb21e2dcc15e83f7e80715e /Remote/Helper/Chunked.hs | |
parent | 51a6a833c5e07d8ac57ab8857c649669502d9f6b (diff) |
better exception display
Diffstat (limited to 'Remote/Helper/Chunked.hs')
-rw-r--r-- | Remote/Helper/Chunked.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs index 5a52a1f4b..5fa6c55ef 100644 --- a/Remote/Helper/Chunked.hs +++ b/Remote/Helper/Chunked.hs @@ -77,7 +77,7 @@ numChunks = pred . fromJust . keyChunkNum . fst . nextChunkKeyStream -} storeChunks :: UUID -> ChunkConfig -> Key -> FilePath -> MeterUpdate -> (Key -> L.ByteString -> MeterUpdate -> IO Bool) -> Annex Bool storeChunks u chunkconfig k f p storer = metered (Just p) k $ \meterupdate -> - either (\e -> liftIO (print e) >> return False) (go meterupdate) + either (\e -> warning (show e) >> return False) (go meterupdate) =<< (liftIO $ tryIO $ L.readFile f) where go meterupdate b = case chunkconfig of @@ -190,7 +190,9 @@ retrieveChunks retriever u chunkconfig encryptor basek basep sink = do ls <- chunkKeys u chunkconfig basek liftIO $ flip catchNonAsync giveup (firstavail ls) where - giveup e = print e >> return False + giveup e = do + warningIO (show e) + return False firstavail [] = return False firstavail ([]:ls) = firstavail ls |