If ghc-mod is compiled with exec-profiling enabled,
it silently exits if the target file includes TH. This patch displays such internal errors.
This commit is contained in:
parent
3330e93912
commit
fe5c8d663b
@ -1,13 +1,15 @@
|
||||
module GHCApi where
|
||||
|
||||
import Control.Exception
|
||||
import Control.Applicative
|
||||
import Control.Exception
|
||||
import CoreMonad
|
||||
import DynFlags
|
||||
import ErrMsg
|
||||
import Exception
|
||||
import GHC
|
||||
import GHC.Paths (libdir)
|
||||
import System.Exit
|
||||
import System.IO
|
||||
import Types
|
||||
|
||||
----------------------------------------------------------------
|
||||
@ -18,7 +20,9 @@ withGHC body = ghandle ignore $ runGhc (Just libdir) $ do
|
||||
defaultCleanupHandler dflags body
|
||||
where
|
||||
ignore :: Alternative m => SomeException -> IO (m a)
|
||||
ignore _ = return empty
|
||||
ignore e = do
|
||||
hPrint stderr e
|
||||
exitFailure
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user