Small fix to error reporting in App.

Closes #3548.
This commit is contained in:
John MacFarlane 2017-04-15 13:46:46 +02:00
parent bcc848d773
commit 629c6494a5

View file

@ -64,7 +64,7 @@ import System.Directory (Permissions (..), doesFileExist, findExecutable,
import System.Environment (getArgs, getEnvironment, getProgName) import System.Environment (getArgs, getEnvironment, getProgName)
import System.Exit (ExitCode (..), exitSuccess) import System.Exit (ExitCode (..), exitSuccess)
import System.FilePath import System.FilePath
import System.IO (stderr, stdout) import System.IO (stdout)
import System.IO.Error (isDoesNotExistError) import System.IO.Error (isDoesNotExistError)
import Text.Pandoc import Text.Pandoc
import Text.Pandoc.Builder (setMeta) import Text.Pandoc.Builder (setMeta)
@ -448,9 +448,7 @@ convertWithOpts opts = do
res <- makePDF pdfprog f writerOptions verbosity media doc' res <- makePDF pdfprog f writerOptions verbosity media doc'
case res of case res of
Right pdf -> writeFnBinary outputFile pdf Right pdf -> writeFnBinary outputFile pdf
Left err' -> liftIO $ do Left err' -> liftIO $
B.hPutStr stderr err'
B.hPut stderr $ B.pack [10]
E.throwIO $ PandocPDFError (UTF8.toStringLazy err') E.throwIO $ PandocPDFError (UTF8.toStringLazy err')
| otherwise -> do | otherwise -> do
let htmlFormat = format `elem` let htmlFormat = format `elem`