git.iko.soy/typeable/pandoc
on master help sign in
Improve handling of bibliography not found error.
b158ae2John MacFarlane
src/pandoc.hs+5−1
@@ -521,7 +521,11 @@ options =
521 , Option "" ["bibliography"]
521 , Option "" ["bibliography"]
522 (ReqArg
522 (ReqArg
523 (\arg opt -> do
523 (\arg opt -> do
524− refs <- readBiblioFile arg ""
524+ refs <- catch (readBiblioFile arg "") $ \e -> do
525+ UTF8.hPutStrLn stderr $
526+ "Error reading bibliography `" ++ arg ++ "'"
527+ UTF8.hPutStrLn stderr $ show e
528+ exitWith (ExitFailure 23)
525 return opt { optBibliography =
529 return opt { optBibliography =
526 optBibliography opt ++ refs } )
530 optBibliography opt ++ refs } )
527 "FILENAME")
531 "FILENAME")