summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-03-02 08:24:00 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2023-03-02 08:24:00 -0800
commit19e4adaeb582d03a52c1a39d257bf3ac2da7d6f0 (patch)
treefb4a975a36e2fea9e6e772c035278c08e471afc8
parent52ef7cac7c2f01166a8382e5e7a50dd38be2fd75 (diff)
EPUB reader: Give additional information in error...
if the epub zip container can't be unpacked. See #8663.
-rw-r--r--src/Text/Pandoc/Readers/EPUB.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/EPUB.hs b/src/Text/Pandoc/Readers/EPUB.hs
index cdf51b429..2a7c54750 100644
--- a/src/Text/Pandoc/Readers/EPUB.hs
+++ b/src/Text/Pandoc/Readers/EPUB.hs
@@ -51,7 +51,8 @@ type Items = M.Map Text (FilePath, MimeType)
readEPUB :: PandocMonad m => ReaderOptions -> BL.ByteString -> m Pandoc
readEPUB opts bytes = case toArchiveOrFail bytes of
Right archive -> archiveToEPUB opts archive
- Left _ -> throwError $ PandocParseError "Couldn't extract ePub file"
+ Left e -> throwError $ PandocParseError $
+ "Couldn't extract ePub file: " <> T.pack e
-- runEPUB :: Except PandocError a -> Either PandocError a
-- runEPUB = runExcept