Catch exceptions when moving files
authorunc0rr
Mon, 18 Feb 2013 00:31:16 +0400
changeset 8511 4f899fbce66d
parent 8510 0a39b2f9c748
child 8512 d2bca8e68688
Catch exceptions when moving files
gameServer/OfficialServer/GameReplayStore.hs
--- a/gameServer/OfficialServer/GameReplayStore.hs	Mon Feb 18 00:28:09 2013 +0400
+++ b/gameServer/OfficialServer/GameReplayStore.hs	Mon Feb 18 00:31:16 2013 +0400
@@ -56,8 +56,10 @@
                 )
 
 moveFailedRecord :: String -> IO ()
-moveFailedRecord fn = renameFile fn ("failed/" ++ drop 8 fn)
+moveFailedRecord fn = E.handle (\(e :: SomeException) -> warningM "REPLAYS" $ show e) $
+    renameFile fn ("failed/" ++ drop 8 fn)
 
 
 moveCheckedRecord :: String -> IO ()
-moveCheckedRecord fn = renameFile fn ("checked/" ++ drop 8 fn)
+moveCheckedRecord fn = E.handle (\(e :: SomeException) -> warningM "REPLAYS" $ show e) $
+    renameFile fn ("checked/" ++ drop 8 fn)