diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-11-13 08:50:04 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-11-13 08:50:04 -0800 |
commit | b158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd (patch) | |
tree | b503fc2a7f3bcaf6158cf3f23b4cfabb34985d97 | |
parent | 7aecddd0f7c22ed2beb1ccf268d3b0e8b2d08831 (diff) | |
download | pandoc-b158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd.tar.gz |
Improve handling of bibliography not found error.
-rw-r--r-- | src/pandoc.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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") |