git.iko.soy/typeable/pandoc
on master help sign in
Add ParseError to PandocExecutionError.
d447552Jesse Rosenthal
src/Text/Pandoc/Class.hs+3−1
@@ -112,6 +112,7 @@ getPOSIXTime = utcTimeToPOSIXSeconds <$> getCurrentTime
112-- We can add to this as we go
112-- We can add to this as we go
113data PandocExecutionError = PandocFileReadError FilePath
113data PandocExecutionError = PandocFileReadError FilePath
114 | PandocShouldNeverHappenError String
114 | PandocShouldNeverHappenError String
115+ | PandocParseError String
115 | PandocSomeError String
116 | PandocSomeError String
116 deriving (Show, Typeable)
117 deriving (Show, Typeable)
117
118
@@ -133,8 +134,9 @@ runIOorExplode ma = do
133 eitherVal <- runIO ma
134 eitherVal <- runIO ma
134 case eitherVal of
135 case eitherVal of
135 Right x -> return x
136 Right x -> return x
136− Left (PandocFileReadError fp) -> error $ "promple reading " ++ fp
137+ Left (PandocFileReadError fp) -> error $ "problem reading " ++ fp
137 Left (PandocShouldNeverHappenError s) -> error s
138 Left (PandocShouldNeverHappenError s) -> error s
139+ Left (PandocParseError s) -> error $ "parse error" ++ s
138 Left (PandocSomeError s) -> error s
140 Left (PandocSomeError s) -> error s
139
141
140newtype PandocIO a = PandocIO {
142newtype PandocIO a = PandocIO {