X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FSysTools.lhs;h=3c465edd7386960e6dcfbc898b4fa201b0758931;hb=3998d13f096efb302cf83865b611746765596754;hp=6d377743c87982935bcc1dfb94c5e5b0bd29d53c;hpb=68db78589f7faa747d26b8f10ba3b037f236c7aa;p=ghc-hetmet.git diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 6d37774..3c465ed 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -48,7 +48,7 @@ import Util import DynFlags import FiniteMap -import Control.Exception +import Exception import Data.IORef import Control.Monad import System.Exit @@ -209,7 +209,7 @@ initSysTools mbMinusB dflags0 -- Check that the package config exists ; config_exists <- doesFileExist pkgconfig_path ; when (not config_exists) $ - throwDyn (InstallationError + ghcError (InstallationError ("Can't find package.conf as " ++ pkgconfig_path)) -- On Windows, gcc and friends are distributed with GHC, @@ -330,7 +330,7 @@ findTopDir mbMinusB -> do maybe_exec_dir <- getBaseDir -- Get directory of executable case maybe_exec_dir of -- (only works on Windows; -- returns Nothing on Unix) - Nothing -> throwDyn (InstallationError "missing -B option") + Nothing -> ghcError (InstallationError "missing -B option") Just dir -> return dir \end{code} @@ -677,9 +677,9 @@ runSomethingFiltered dflags filter_fn phase_name pgm args mb_env = do then return (ExitFailure 1, True) else IO.ioError err) case (doesn'tExist, exit_code) of - (True, _) -> throwDyn (InstallationError ("could not execute: " ++ pgm)) + (True, _) -> ghcError (InstallationError ("could not execute: " ++ pgm)) (_, ExitSuccess) -> return () - _ -> throwDyn (PhaseFailed phase_name exit_code) + _ -> ghcError (PhaseFailed phase_name exit_code) builderMainLoop :: DynFlags -> (String -> String) -> FilePath -> [String] -> Maybe [(String, String)] @@ -817,7 +817,7 @@ traceCmd dflags phase_name cmd_line action where handle_exn _verb exn = do { debugTraceMsg dflags 2 (char '\n') ; debugTraceMsg dflags 2 (ptext (sLit "Failed:") <+> text cmd_line <+> text (show exn)) - ; throwDyn (PhaseFailed phase_name (ExitFailure 1)) } + ; ghcError (PhaseFailed phase_name (ExitFailure 1)) } \end{code} %************************************************************************