git.iko.soy/typeable/pandoc
on master help sign in
Error: Added PandocPDFError
306dc62John MacFarlane
src/Text/Pandoc/App.hs+1−1
@@ -451,7 +451,7 @@ convertWithOpts opts = do
451 Left err' -> liftIO $ do
451 Left err' -> liftIO $ do
452 B.hPutStr stderr err'
452 B.hPutStr stderr err'
453 B.hPut stderr $ B.pack [10]
453 B.hPut stderr $ B.pack [10]
454− E.throwIO $ PandocAppError 43 "Error producing PDF"
454+ E.throwIO $ PandocPDFError (UTF8.toStringLazy err')
455 | otherwise -> do
455 | otherwise -> do
456 let htmlFormat = format `elem`
456 let htmlFormat = format `elem`
457 ["html","html4","html5","s5","slidy","slideous","dzslides","revealjs"]
457 ["html","html4","html5","s5","slidy","slideous","dzslides","revealjs"]
src/Text/Pandoc/Error.hs+2
@@ -55,6 +55,7 @@ data PandocError = PandocIOError String IOError
55 | PandocSyntaxMapError String
55 | PandocSyntaxMapError String
56 | PandocFailOnWarningError
56 | PandocFailOnWarningError
57 | PandocPDFProgramNotFoundError String
57 | PandocPDFProgramNotFoundError String
58+ | PandocPDFError String
58 | PandocAppError Int String
59 | PandocAppError Int String
59 deriving (Show, Typeable, Generic)
60 deriving (Show, Typeable, Generic)
60
61
@@ -86,6 +87,7 @@ handleError (Left e) =
86 PandocFailOnWarningError -> err 3 "Failing because there were warnings."
87 PandocFailOnWarningError -> err 3 "Failing because there were warnings."
87 PandocPDFProgramNotFoundError pdfprog -> err 47 $
88 PandocPDFProgramNotFoundError pdfprog -> err 47 $
88 pdfprog ++ " not found. " ++ pdfprog ++ " is needed for pdf output."
89 pdfprog ++ " not found. " ++ pdfprog ++ " is needed for pdf output."
90+ PandocPDFError log -> err 43 $ "Error producing PDF.\n" ++ log
89 PandocAppError ec s -> err ec s
91 PandocAppError ec s -> err ec s
90
92
91err :: Int -> String -> IO a
93err :: Int -> String -> IO a