Skip to content

Commit

Permalink
Show errors from executing processes
Browse files Browse the repository at this point in the history
  • Loading branch information
bendlas committed Apr 4, 2016
1 parent c77576f commit 14044fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ runInteractiveProcess cmd args cwd env withOutput
getOutput = Concurrently (withOutput out)
getErrors = Concurrently (S.fold (<>) T.empty =<< S.decodeUtf8 err)
wait = Concurrently (S.waitForProcess pid)
(result, errorMessage, exit) <- runConcurrently
((,,) <$> getOutput <*> getErrors <*> wait)
(errorMessage, exit) <- runConcurrently ((,) <$> getErrors <*> wait)
case exit of
ExitSuccess -> pure result
ExitSuccess -> runConcurrently getOutput
ExitFailure code -> throwIO (Died code errorMessage)

showExceptions :: IO b -> IO (Maybe b)
Expand Down

0 comments on commit 14044fb

Please sign in to comment.