EPUB reader: Give additional information in error...

if the epub zip container can't be unpacked.

See #8663.
This commit is contained in:
John MacFarlane
2023-03-02 08:24:00 -08:00
parent 52ef7cac7c
commit 19e4adaeb5
+2 -1
View File
@@ -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