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
|
module GHCApi where
|
||||||
|
|
||||||
import Control.Exception
|
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
|
import Control.Exception
|
||||||
import CoreMonad
|
import CoreMonad
|
||||||
import DynFlags
|
import DynFlags
|
||||||
import ErrMsg
|
import ErrMsg
|
||||||
import Exception
|
import Exception
|
||||||
import GHC
|
import GHC
|
||||||
import GHC.Paths (libdir)
|
import GHC.Paths (libdir)
|
||||||
|
import System.Exit
|
||||||
|
import System.IO
|
||||||
import Types
|
import Types
|
||||||
|
|
||||||
----------------------------------------------------------------
|
----------------------------------------------------------------
|
||||||
@ -18,7 +20,9 @@ withGHC body = ghandle ignore $ runGhc (Just libdir) $ do
|
|||||||
defaultCleanupHandler dflags body
|
defaultCleanupHandler dflags body
|
||||||
where
|
where
|
||||||
ignore :: Alternative m => SomeException -> IO (m a)
|
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