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:
parent
b34bb8be01
commit
d447552be1
1 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue