aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-11-13 08:50:04 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-11-13 08:50:04 -0800
commitb158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd (patch)
treeb503fc2a7f3bcaf6158cf3f23b4cfabb34985d97
parent7aecddd0f7c22ed2beb1ccf268d3b0e8b2d08831 (diff)
downloadpandoc-b158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd.tar.gz
Improve handling of bibliography not found error.
-rw-r--r--src/pandoc.hs6
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")