git.iko.soy/typeable/pandoc
on master help sign in
ODT reader: give more information if zip can't be unpacked.
commit5cd1c1001fbfc768fdb146f14ae056a9a7ba94eb authorJohn MacFarlane <jgm@berkeley.edu> dateMon 8 Feb 2021, 09:15 (6 years ago) parent69b7401
1 file changed+4−1
src/Text/Pandoc/Readers/Odt.hs+4−1
src/Text/Pandoc/Readers/Odt.hs+4−1
@@ -23,6 +23,8 @@ import System.FilePath
2323
2424import Control.Monad.Except (throwError)
2525
26+import qualified Data.Text as T
27+
2628import Text.Pandoc.Class.PandocMonad (PandocMonad)
2729import qualified Text.Pandoc.Class.PandocMonad as P
2830import Text.Pandoc.Definition
@@ -60,7 +62,8 @@ readOdt' _ bytes = bytesToOdt bytes-- of
6062bytesToOdt :: B.ByteString -> Either PandocError (Pandoc, MediaBag)
6163bytesToOdt bytes = case toArchiveOrFail bytes of
6264 Right archive -> archiveToOdt archive
63− Left _ -> Left $ PandocParseError "Couldn't parse odt file."
65+ Left err -> Left $ PandocParseError
66+ $ "Could not unzip ODT: " <> T.pack err
6467
6568--
6669archiveToOdt :: Archive -> Either PandocError (Pandoc, MediaBag)