Commit c07d3f2e authored by md9ms's avatar md9ms
Browse files

Make error printing slightly prettier

parent 46d392ad
......@@ -169,7 +169,7 @@ parsePackageDesc :: FilePath -> IO PackageDescription
parsePackageDesc p = do h <- openFile p ReadMode
str <- hGetContents h
case parseDescription str of
Left e -> error (show e) -- FIXME
Left e -> error (showError e) -- FIXME
Right x -> return x
data PError = Parsec ParseError | FromString String
......@@ -178,6 +178,9 @@ data PError = Parsec ParseError | FromString String
instance Error PError where
strMsg = FromString
showError (Parsec pe) = show pe
showError (FromString s) = s
parseDescription :: String -> Either PError PackageDescription
parseDescription inp = do let (st:sts) = splitStanzas inp
pkg <- foldM parseBasicStanza emptyPackageDescription st
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment