LIB: simplify error handling

'bracket' already handles this.
This commit is contained in:
hasufell 2016-04-08 03:00:37 +02:00
parent 7f086911e1
commit 5bce5dd6ff

View File

@ -36,8 +36,7 @@ import Control.Exception
)
import Control.Exception.Base
(
onException
, IOException
IOException
)
import Control.Monad.State.Lazy
(
@ -622,8 +621,7 @@ getDirsFiles' filterf fp =
-- make sure we close the directory stream in case of errors
-- TODO: more explicit error handling?
-- both the parsing and readin the stream can fail!
dir <- onException (PFD.readDirStream dirstream)
(PFD.closeDirStream dirstream)
dir <- PFD.readDirStream dirstream
case dir of
"" -> return dirs
_ -> do