@@ -181,7 +181,7 @@ convertWithOpts opts = do
181 "\nTo create a pdf using pandoc, use " ++
181 "\nTo create a pdf using pandoc, use " ++
182 "-t latex|beamer|context|ms|html5" ++
182 "-t latex|beamer|context|ms|html5" ++
183 "\nand specify an output file with " ++
183 "\nand specify an output file with " ++
184− ".pdf extension (-o filename.pdf)." ++
184+ ".pdf extension (-o filename.pdf)."
186 Right w -> return (w :: Writer PandocIO)
186 Right w -> return (w :: Writer PandocIO)
@@ -304,7 +304,7 @@ convertWithOpts opts = do
304 let addSyntaxMap existingmap f = do
304 let addSyntaxMap existingmap f = do
305 res <- parseSyntaxDefinition f
305 res <- parseSyntaxDefinition f
306 case res of
306 case res of
307− Left errstr -> E.throwIO $ PandocAppError 67 errstr
307+ Left errstr -> E.throwIO $ PandocSyntaxMapError errstr
308 Right syn -> return $ addSyntaxDefinition syn existingmap
308 Right syn -> return $ addSyntaxDefinition syn existingmap
310 syntaxMap <- foldM addSyntaxMap defaultSyntaxMap
310 syntaxMap <- foldM addSyntaxMap defaultSyntaxMap
@@ -312,7 +312,7 @@ convertWithOpts opts = do
313 case missingIncludes (M.elems syntaxMap) of
313 case missingIncludes (M.elems syntaxMap) of
314 [] -> return ()
314 [] -> return ()
315− xs -> E.throwIO $ PandocAppError 73 $
315+ xs -> E.throwIO $ PandocSyntaxMapError $
316 "Missing syntax definitions:\n" ++
316 "Missing syntax definitions:\n" ++
317 unlines (map
317 unlines (map
318 (\(syn,dep) -> (T.unpack syn ++ " requires " ++
318 (\(syn,dep) -> (T.unpack syn ++ " requires " ++
@@ -388,8 +388,7 @@ convertWithOpts opts = do
388 Just logfile -> B.writeFile logfile (encodeLogMessages reports)
388 Just logfile -> B.writeFile logfile (encodeLogMessages reports)
389 let isWarning msg = messageVerbosity msg == WARNING
389 let isWarning msg = messageVerbosity msg == WARNING
390 when (optFailIfWarnings opts && any isWarning reports) $
390 when (optFailIfWarnings opts && any isWarning reports) $
391− E.throwIO $
391+ E.throwIO PandocFailOnWarningError
392− PandocAppError 3 "Failing because there were warnings."
393 return res
392 return res
395 let sourceToDoc :: [FilePath] -> PandocIO (Pandoc, MediaBag)
394 let sourceToDoc :: [FilePath] -> PandocIO (Pandoc, MediaBag)
@@ -443,10 +442,8 @@ convertWithOpts opts = do
443 | otherwise -> optLaTeXEngine opts
442 | otherwise -> optLaTeXEngine opts
444 -- check for pdf creating program
443 -- check for pdf creating program
445 mbPdfProg <- liftIO $ findExecutable pdfprog
444 mbPdfProg <- liftIO $ findExecutable pdfprog
446− when (isNothing mbPdfProg) $
445+ when (isNothing mbPdfProg) $ liftIO $ E.throwIO $
447− liftIO $ E.throwIO $ PandocAppError 41 $
446+ PandocPDFProgramNotFoundError pdfprog
448− pdfprog ++ " not found. " ++
449− pdfprog ++ " is needed for pdf output."
451 res <- makePDF pdfprog f writerOptions verbosity media doc'
448 res <- makePDF pdfprog f writerOptions verbosity media doc'
452 case res of
449 case res of