error reporting

This commit is contained in:
Joey Hess 2013-12-06 15:15:47 -04:00
parent b370f52f88
commit 1910795ddf

View file

@ -114,7 +114,9 @@ getOutput cmd params env = do
processTranscript' cmd params env Nothing processTranscript' cmd params env Nothing
runParser' :: Parser a -> String -> a runParser' :: Parser a -> String -> a
runParser' p s = either (error . show) id (parse p "" s) runParser' p s = either failedparse id (parse p "" s)
where
failedparse e = error $ (show e) ++ "\nInput:\n" ++ s
atFile :: FilePath -> String atFile :: FilePath -> String
atFile f = '@':f atFile f = '@':f