summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-15 12:05:58 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-15 12:05:58 +0200
commit1fe1c162ac1891fc688e1aef207dd60e18672c06 (patch)
tree22c7ff93c0de8b4e4d82247b2578663cb45af071 /src/Text/Pandoc/Shared.hs
parent76b051f7b44f0df850aafe2f57a44f0486b8b282 (diff)
Error: Added PandocCouldNotFindDataFileError.
Use this instead of PandocAppError when appropriate. Removed exit code from PandocAppError, use 1 for all.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index dfdbaf428..8256d14c0 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -674,8 +674,7 @@ readDefaultDataFile "reference.odt" =
readDefaultDataFile fname =
#ifdef EMBED_DATA_FILES
case lookup (makeCanonical fname) dataFiles of
- Nothing -> E.throwIO $ PandocAppError 97 $
- "Could not find data file " ++ fname
+ Nothing -> E.throwIO $ PandocCouldNotFindDataFileError fname
Just contents -> return contents
where makeCanonical = Posix.joinPath . transformPathParts . splitDirectories
transformPathParts = reverse . foldl go []
@@ -691,7 +690,7 @@ checkExistence fn = do
exists <- doesFileExist fn
if exists
then return fn
- else E.throwIO $ PandocAppError 97 ("Could not find data file " ++ fn)
+ else E.throwIO $ PandocCouldNotFindDataFileError fn
#endif
-- | Read file from specified user data directory or, if not found there, from