diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-06 18:50:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-06 18:50:13 -0400 |
commit | 766d720aa6be715fcfef538aab48872cefa7f0e0 (patch) | |
tree | 2f42428483c1dcf8ed7050c42d6d19d4ace736ba | |
parent | 3161983a472c851994ad083ef13ebf7e04e71cbd (diff) |
improve debuggin on failure
-rw-r--r-- | Build/EvilLinker.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs index daa09d148..db9c84107 100644 --- a/Build/EvilLinker.hs +++ b/Build/EvilLinker.hs @@ -115,10 +115,13 @@ getOutput cmd params env = do putStrLn $ unwords [cmd, show params] processTranscript' cmd params env Nothing -runParser' :: Parser a -> String -> a -runParser' p s = either failedparse id (parse p "" s) +runParser' :: Parser a -> String -> String -> a +runParser' p s paramfile = either failedparse id (parse p "" s) 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 f = '@':f @@ -130,7 +133,7 @@ runAtFile p s f extraparams = do removeFile f return out where - c = runParser' p s + c = runParser' p s (opts c) main = do ghcout <- fst <$> getOutput "cabal" |