better exception display

This commit is contained in:
Joey Hess 2014-07-26 23:01:44 -04:00
parent 0d89b65bfc
commit 867fd116a7
5 changed files with 10 additions and 8 deletions

View file

@ -114,10 +114,10 @@ prepareStore d chunkconfig k = ifM (checkDiskSpace (Just d) k 0)
store :: FilePath -> ChunkConfig -> Storer
store d chunkconfig k b p = do
void $ liftIO $ tryIO $ createDirectoryIfMissing True tmpdir
void $ tryIO $ createDirectoryIfMissing True tmpdir
case chunkconfig of
LegacyChunks chunksize -> Legacy.store chunksize finalizer k b p tmpdir destdir
_ -> flip catchNonAsync (\e -> print e >> return False) $ do
_ -> flip catchNonAsync (\e -> warningIO (show e) >> return False) $ do
let tmpf = tmpdir </> keyFile k
meteredWriteFile p tmpf b
finalizer tmpdir destdir