summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/pandoc.hs b/pandoc.hs
index a16ffbc3c..8eed67544 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -91,14 +91,14 @@ isTextFormat :: String -> Bool
isTextFormat s = takeWhile (`notElem` "+-") s `notElem` ["odt","docx","epub","epub3"]
externalFilter :: FilePath -> [String] -> Pandoc -> IO Pandoc
-externalFilter f args' d = E.handle filterException $
- do (exitcode, outbs, errbs) <- pipeProcess Nothing f args' $ encode d
+externalFilter f args' d = do
+ (exitcode, outbs, errbs) <- E.handle filterException $
+ pipeProcess Nothing f args' $ encode d
when (not $ B.null errbs) $ B.hPutStr stderr errbs
case exitcode of
ExitSuccess -> return $ either error id $ eitherDecode' outbs
- ExitFailure _ -> err 83 $ "Error running filter " ++ f ++ "\n" ++
- UTF8.toStringLazy outbs
- where filterException :: E.SomeException -> IO Pandoc
+ ExitFailure _ -> err 83 $ "Error running filter " ++ f
+ where filterException :: E.SomeException -> IO a
filterException e = err 83 $ "Error running filter " ++ f ++
"\n" ++ show e