From 5bce5dd6ffc60ce02ee10895a9933f6c0868f4cf Mon Sep 17 00:00:00 2001 From: hasufell Date: Fri, 8 Apr 2016 03:00:37 +0200 Subject: [PATCH] LIB: simplify error handling 'bracket' already handles this. --- src/HSFM/FileSystem/FileType.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/HSFM/FileSystem/FileType.hs b/src/HSFM/FileSystem/FileType.hs index 26eee41..39d3e7f 100644 --- a/src/HSFM/FileSystem/FileType.hs +++ b/src/HSFM/FileSystem/FileType.hs @@ -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