summaryrefslogtreecommitdiffhomepage
path: root/Storage
diff options
context:
space:
mode:
Diffstat (limited to 'Storage')
-rw-r--r--Storage/Local.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Storage/Local.hs b/Storage/Local.hs
index 99b92db..e061831 100644
--- a/Storage/Local.hs
+++ b/Storage/Local.hs
@@ -15,6 +15,7 @@ import Types
import Types.Storage
import Serialization ()
import Utility.UserInfo
+import Utility.Exception
import qualified Data.ByteString as B
import qualified Data.ByteString.UTF8 as U8
import Data.Monoid
@@ -26,9 +27,9 @@ import System.Posix
import System.FilePath
import Raaz.Core.Encode
import Control.DeepSeq
-import Control.Exception
import Control.Monad
import System.DiskSpace
+import Control.Exception (IOException)
type GetShareDir = Section -> IO FilePath
@@ -99,7 +100,7 @@ count section getsharedir = onError (CountFailure . show) $ do
move :: Section -> GetShareDir -> Storage -> IO [StoreResult]
move section getsharedir storage = do
dir <- getsharedir section
- fs <- map (dir </>) <$> getDirectoryContents dir
+ fs <- map (dir </>) <$> catchDefaultIO [] (getDirectoryContents dir)
rs <- forM fs $ \f -> case fromShareFile f of
Nothing -> return Nothing
Just i -> Just <$> go f i