From b158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 13 Nov 2010 08:50:04 -0800 Subject: Improve handling of bibliography not found error. --- src/pandoc.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pandoc.hs b/src/pandoc.hs index d6b40cc94..0cca48b6f 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -521,7 +521,11 @@ options = , Option "" ["bibliography"] (ReqArg (\arg opt -> do - refs <- readBiblioFile arg "" + refs <- catch (readBiblioFile arg "") $ \e -> do + UTF8.hPutStrLn stderr $ + "Error reading bibliography `" ++ arg ++ "'" + UTF8.hPutStrLn stderr $ show e + exitWith (ExitFailure 23) return opt { optBibliography = optBibliography opt ++ refs } ) "FILENAME") -- cgit v1.2.3