aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-11-28 16:54:00 -0500
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:40 +0100
commitd447552be1c60d5a6ba15cd2a91395e32c8e0554 (patch)
treec47e638b06ada237a5ec75ada0b4afcef3d10770 /src
parentb34bb8be015ab05f582bddf8f9acd2a5dbcce793 (diff)
downloadpandoc-d447552be1c60d5a6ba15cd2a91395e32c8e0554.tar.gz
Add ParseError to PandocExecutionError.
This will be unified with Text.Pandoc.Error eventually. But I'm building it out here so as not to interfere with other modules that might be using the error module currently.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Class.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index bcd0d4172..13fdc3e50 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -112,6 +112,7 @@ getPOSIXTime = utcTimeToPOSIXSeconds <$> getCurrentTime
-- We can add to this as we go
data PandocExecutionError = PandocFileReadError FilePath
| PandocShouldNeverHappenError String
+ | PandocParseError String
| PandocSomeError String
deriving (Show, Typeable)
@@ -133,8 +134,9 @@ runIOorExplode ma = do
eitherVal <- runIO ma
case eitherVal of
Right x -> return x
- Left (PandocFileReadError fp) -> error $ "promple reading " ++ fp
+ Left (PandocFileReadError fp) -> error $ "problem reading " ++ fp
Left (PandocShouldNeverHappenError s) -> error s
+ Left (PandocParseError s) -> error $ "parse error" ++ s
Left (PandocSomeError s) -> error s
newtype PandocIO a = PandocIO {