How to ignore exception or Error and continue IO actions in Haskell?
main :: IO ()
main = do
res <- try (mapM_ (callProcess "pandoc") [["--help"],["-eoc"],["-exois"],["--help"]]) :: IO (Either SomeException ())
case res of
Right a -> print "done"
Left e -> print "error"
in the above code, some of the argument for the command pandoc are wrong and pandoc will throw errors. but I want my code to continue without stopping there and finish the mapM_
What Exception handling should I use?
The error I have is:
pandoc: unrecognized option `-e'
Try pandoc --help for more information.