summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-13 17:38:42 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-15 11:53:45 +0200
commit306dc624d982663e07d91bef6d2f84d311b978af (patch)
tree4b41f9f564cd6b4196971540ae0c8297cfa63a0b /src
parentd5701e625ceff494f4a54aa82490fe8e82dd1672 (diff)
Error: Added PandocPDFError
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/App.hs2
-rw-r--r--src/Text/Pandoc/Error.hs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
index e44c6ebfb..b34980c71 100644
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -451,7 +451,7 @@ convertWithOpts opts = do
Left err' -> liftIO $ do
B.hPutStr stderr err'
B.hPut stderr $ B.pack [10]
- E.throwIO $ PandocAppError 43 "Error producing PDF"
+ E.throwIO $ PandocPDFError (UTF8.toStringLazy err')
| otherwise -> do
let htmlFormat = format `elem`
["html","html4","html5","s5","slidy","slideous","dzslides","revealjs"]
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index 36e9cca63..b6782036f 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -55,6 +55,7 @@ data PandocError = PandocIOError String IOError
| PandocSyntaxMapError String
| PandocFailOnWarningError
| PandocPDFProgramNotFoundError String
+ | PandocPDFError String
| PandocAppError Int String
deriving (Show, Typeable, Generic)
@@ -86,6 +87,7 @@ handleError (Left e) =
PandocFailOnWarningError -> err 3 "Failing because there were warnings."
PandocPDFProgramNotFoundError pdfprog -> err 47 $
pdfprog ++ " not found. " ++ pdfprog ++ " is needed for pdf output."
+ PandocPDFError log -> err 43 $ "Error producing PDF.\n" ++ log
PandocAppError ec s -> err ec s
err :: Int -> String -> IO a