Skip to content
Snippets Groups Projects
Verified Commit 1f71b604 authored by Legy (Beini)'s avatar Legy (Beini)
Browse files

Let tryMaybe catch SomeException instad of IOException

parent b68c925b
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
module QBar.Blocks.Utils where
import Control.Exception (IOException, catch)
import Control.Exception (SomeException, catch)
import qualified Data.Attoparsec.Text.Lazy as AT
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as TIO
......@@ -23,7 +23,7 @@ tryMaybe :: IO a -> IO (Maybe a)
tryMaybe a = tryMaybe' (Just <$> a)
tryMaybe' :: IO (Maybe a) -> IO (Maybe a)
tryMaybe' a = catch a (\(_ :: IOException) -> return Nothing)
tryMaybe' a = catch a $ \(_ :: SomeException) -> return Nothing
parseFile :: FilePath -> AT.Parser a -> IO (Maybe a)
parseFile path parser = tryMaybe' $ do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment