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

Change a few throwGhcException uses to throwGhcExceptionIO

parent 0a1b7cb8
......@@ -618,7 +618,7 @@ guessTarget str Nothing
then return (target (TargetModule (mkModuleName file)))
else do
dflags <- getDynFlags
throwGhcException
liftIO $ throwGhcExceptionIO
(ProgramError (showSDoc dflags $
text "target" <+> quotes (text file) <+>
text "is not a module name or a source file"))
......@@ -1323,7 +1323,7 @@ findModule mod_name maybe_pkg = withSession $ \hsc_env -> do
err -> noModError dflags noSrcSpan mod_name err
modNotLoadedError :: DynFlags -> Module -> ModLocation -> IO a
modNotLoadedError dflags m loc = throwGhcException $ CmdLineError $ showSDoc dflags $
modNotLoadedError dflags m loc = throwGhcExceptionIO $ CmdLineError $ showSDoc dflags $
text "module is not loaded:" <+>
quotes (ppr (moduleName m)) <+>
parens (text (expectJust "modNotLoadedError" (ml_hs_file loc)))
......
......@@ -89,10 +89,10 @@ parseStaticFlagsFull :: [Flag IO] -> [Located String]
-> IO ([Located String], [Located String])
parseStaticFlagsFull flagsAvailable args = do
ready <- readIORef v_opt_C_ready
when ready $ throwGhcException (ProgramError "Too late for parseStaticFlags: call it before newSession")
when ready $ throwGhcExceptionIO (ProgramError "Too late for parseStaticFlags: call it before newSession")
(leftover, errs, warns) <- processArgs flagsAvailable args
when (not (null errs)) $ throwGhcException $ errorsToGhcException errs
when (not (null errs)) $ throwGhcExceptionIO $ errorsToGhcException errs
-- see sanity code in staticOpts
writeIORef v_opt_C_ready True
......
Markdown is supported
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