LIB: simplify error handling
'bracket' already handles this.
This commit is contained in:
parent
7f086911e1
commit
5bce5dd6ff
@ -36,8 +36,7 @@ import Control.Exception
|
|||||||
)
|
)
|
||||||
import Control.Exception.Base
|
import Control.Exception.Base
|
||||||
(
|
(
|
||||||
onException
|
IOException
|
||||||
, IOException
|
|
||||||
)
|
)
|
||||||
import Control.Monad.State.Lazy
|
import Control.Monad.State.Lazy
|
||||||
(
|
(
|
||||||
@ -622,8 +621,7 @@ getDirsFiles' filterf fp =
|
|||||||
-- make sure we close the directory stream in case of errors
|
-- make sure we close the directory stream in case of errors
|
||||||
-- TODO: more explicit error handling?
|
-- TODO: more explicit error handling?
|
||||||
-- both the parsing and readin the stream can fail!
|
-- both the parsing and readin the stream can fail!
|
||||||
dir <- onException (PFD.readDirStream dirstream)
|
dir <- PFD.readDirStream dirstream
|
||||||
(PFD.closeDirStream dirstream)
|
|
||||||
case dir of
|
case dir of
|
||||||
"" -> return dirs
|
"" -> return dirs
|
||||||
_ -> do
|
_ -> do
|
||||||
|
Loading…
Reference in New Issue
Block a user