From 19e4adaeb582d03a52c1a39d257bf3ac2da7d6f0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Mar 2023 08:24:00 -0800 Subject: EPUB reader: Give additional information in error... if the epub zip container can't be unpacked. See #8663. --- src/Text/Pandoc/Readers/EPUB.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text') 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 -- cgit v1.2.3