aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Odt.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-02-08 09:15:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2021-02-08 09:39:59 -0800
commit5cd1c1001fbfc768fdb146f14ae056a9a7ba94eb (patch)
tree03a0cac7868102be87530a360e7639b92645fa98 /src/Text/Pandoc/Readers/Odt.hs
parent69b7401e31216ae52164950970cf88b778d8d198 (diff)
downloadpandoc-5cd1c1001fbfc768fdb146f14ae056a9a7ba94eb.tar.gz
ODT reader: give more information if zip can't be unpacked.
Diffstat (limited to 'src/Text/Pandoc/Readers/Odt.hs')
-rw-r--r--src/Text/Pandoc/Readers/Odt.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Odt.hs b/src/Text/Pandoc/Readers/Odt.hs
index 7b8bfd4b5..9b66b60ec 100644
--- a/src/Text/Pandoc/Readers/Odt.hs
+++ b/src/Text/Pandoc/Readers/Odt.hs
@@ -23,6 +23,8 @@ import System.FilePath
import Control.Monad.Except (throwError)
+import qualified Data.Text as T
+
import Text.Pandoc.Class.PandocMonad (PandocMonad)
import qualified Text.Pandoc.Class.PandocMonad as P
import Text.Pandoc.Definition
@@ -60,7 +62,8 @@ readOdt' _ bytes = bytesToOdt bytes-- of
bytesToOdt :: B.ByteString -> Either PandocError (Pandoc, MediaBag)
bytesToOdt bytes = case toArchiveOrFail bytes of
Right archive -> archiveToOdt archive
- Left _ -> Left $ PandocParseError "Couldn't parse odt file."
+ Left err -> Left $ PandocParseError
+ $ "Could not unzip ODT: " <> T.pack err
--
archiveToOdt :: Archive -> Either PandocError (Pandoc, MediaBag)