Commit 729cd551 authored by rwbarton's avatar rwbarton
Browse files

Catch exceptions in findUsableBranchers

In the version of process that comes with GHC 7.7,
readProcessWithExitCode raises an exception when
the process could not be started (for example if
the command to be run doesn't exist).
parent 8b838b65
......@@ -39,7 +39,7 @@ import Distribution.Client.IndexUtils as IndexUtils
( getSourcePackages )
import Control.Exception
( finally )
( catch, finally )
import Control.Monad
( filterM, forM_, unless, when )
import Data.List
......@@ -204,7 +204,7 @@ allBranchers =
-- exits successfully, that brancher is considered usable.
findUsableBranchers :: IO (Data.Map.Map PD.RepoType Brancher)
findUsableBranchers = do
let usable (_, brancher) = do
let usable (_, brancher) = flip catch (const (return False) :: IOError -> IO Bool) $ do
let cmd = brancherBinary brancher
(exitCode, _, _) <- readProcessWithExitCode cmd ["--help"] ""
return (exitCode == ExitSuccess)
......
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