From d447552be1c60d5a6ba15cd2a91395e32c8e0554 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 28 Nov 2016 16:54:00 -0500 Subject: 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. --- src/Text/Pandoc/Class.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Text') 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 { -- cgit v1.2.3