Commit a079a257 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Fix process004 following the error improvements

parent 6cdeb1e6
module Main where
import System.IO.Error
import System.Process
main = do
main :: IO ()
main = do test1 `catchIOError` \e -> putStrLn ("Exc: " ++ show e)
test2 `catchIOError` \e -> putStrLn ("Exc: " ++ show e)
test1 :: IO ()
test1 = do
(_, _, _, commhand) <-
runInteractiveProcess "true" [] (Just "/no/such/dir") Nothing
exitCode <- waitForProcess commhand
print exitCode
test2 :: IO ()
test2 = do
commhand <- runProcess "true" [] (Just "/no/such/dir") Nothing
Nothing Nothing Nothing
exitCode <- waitForProcess commhand
print exitCode
ExitFailure 126
ExitFailure 126
Exc: true: runInteractiveProcess: runInteractiveProcess: chdir: does not exist (No such file or directory)
Exc: true: runProcess: runInteractiveProcess: chdir: does not exist (No such file or directory)
Supports Markdown
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