diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-05-01 17:40:04 -0400 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-05-01 18:27:20 -0400 |
commit | 99eac312feb258ac4129c923e5b4fde57da9fbc3 (patch) | |
tree | 88be30f46cc1751aae5e4103e49790563c060f96 /src/Text/Pandoc/Readers/Odt.hs | |
parent | 1fbe79db05c55495cf9096cb5be15e499d9a21ec (diff) | |
download | pandoc-99eac312feb258ac4129c923e5b4fde57da9fbc3.tar.gz |
Binary fmts throw PandocError on zip-archive fail
Commit 91dc3342 made `readDocx` throw PandocError if there was an
unarchiving error. This extends that fix to `readOdt` and `readEPUB`.
Diffstat (limited to 'src/Text/Pandoc/Readers/Odt.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Odt.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Odt.hs b/src/Text/Pandoc/Readers/Odt.hs index a925c1d84..68e89263c 100644 --- a/src/Text/Pandoc/Readers/Odt.hs +++ b/src/Text/Pandoc/Readers/Odt.hs @@ -59,7 +59,9 @@ readOdt _ bytes = case bytesToOdt bytes of -- bytesToOdt :: B.ByteString -> Either PandocError Pandoc -bytesToOdt bytes = archiveToOdt $ toArchive bytes +bytesToOdt bytes = case toArchiveOrFail bytes of + Right archive -> archiveToOdt archive + Left _ -> Left $ ParseFailure "Couldn't parse odt file." -- archiveToOdt :: Archive -> Either PandocError Pandoc |