1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-23 14:16:24 +03:00

Do not use GHC's defaultErrorHandler

It makes the exceptions get wrapped as GHC panic's.
This commit is contained in:
Utku Demir 2019-09-16 14:08:58 +12:00 committed by Mark Karpov
parent ed27fb4a9a
commit 4bed990334

View File

@ -131,9 +131,10 @@ initDynFlagsPure fp input = do
-- | Default runner of 'GHC.Ghc' action in 'IO'.
ghcWrapper :: GHC.Ghc a -> IO a
ghcWrapper
= GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut
. GHC.runGhc (Just libdir)
ghcWrapper act =
let GHC.FlushOut flushOut = GHC.defaultFlushOut
in GHC.runGhc (Just libdir) act
`finally` flushOut
-- | Run a 'GHC.P' computation.