improve debuggin on failure
This commit is contained in:
parent
ce3f5138c2
commit
5cdd933117
1 changed files with 7 additions and 4 deletions
|
@ -115,10 +115,13 @@ getOutput cmd params env = do
|
||||||
putStrLn $ unwords [cmd, show params]
|
putStrLn $ unwords [cmd, show params]
|
||||||
processTranscript' cmd params env Nothing
|
processTranscript' cmd params env Nothing
|
||||||
|
|
||||||
runParser' :: Parser a -> String -> a
|
runParser' :: Parser a -> String -> String -> a
|
||||||
runParser' p s = either failedparse id (parse p "" s)
|
runParser' p s paramfile = either failedparse id (parse p "" s)
|
||||||
where
|
where
|
||||||
failedparse e = error $ (show e) ++ "\n<<<\n" ++ s ++ "\n>>>"
|
failedparse e = error $
|
||||||
|
(show e) ++
|
||||||
|
"\n<<<\n" ++ s ++ "\n>>>" ++
|
||||||
|
"\nparam file contained: <<<\n" ++ paramfile ++ "\n>>>"
|
||||||
|
|
||||||
atFile :: FilePath -> String
|
atFile :: FilePath -> String
|
||||||
atFile f = '@':f
|
atFile f = '@':f
|
||||||
|
@ -130,7 +133,7 @@ runAtFile p s f extraparams = do
|
||||||
removeFile f
|
removeFile f
|
||||||
return out
|
return out
|
||||||
where
|
where
|
||||||
c = runParser' p s
|
c = runParser' p s (opts c)
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
ghcout <- fst <$> getOutput "cabal"
|
ghcout <- fst <$> getOutput "cabal"
|
||||||
|
|
Loading…
Add table
Reference in a new issue