git.iko.soy/typeable/pandoc
on master help sign in
Improve handling of bibliography not found error.
commitb158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd authorJohn MacFarlane <jgm@berkeley.edu> dateSat 13 Nov 2010, 08:50 (16 years ago) parent7aecddd
1 file changed+5−1
src/pandoc.hs+5−1
src/pandoc.hs+5−1
@@ -521,7 +521,11 @@ options =
521521 , Option "" ["bibliography"]
522522 (ReqArg
523523 (\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)
525529 return opt { optBibliography =
526530 optBibliography opt ++ refs } )
527531 "FILENAME")