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.
This commit is contained in:
Jesse Rosenthal 2016-11-28 16:54:00 -05:00 committed by John MacFarlane
parent b34bb8be01
commit d447552be1

View file

@ -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 {