Do not use GHC's defaultErrorHandler
It makes the exceptions get wrapped as GHC panic's.
commit4bed990334188a01b268a853685ba32f04958435
authorUtku Demir <me@utdemir.com>
dateMon 16 Sep 2019, 14:08 (7 years ago)
parented27fb4
src/Ormolu/Parser.hs+4−3
@@ -131,9 +131,10 @@ initDynFlagsPure fp input = do
131131-- | Default runner of 'GHC.Ghc' action in 'IO'.
132132
133133ghcWrapper :: GHC.Ghc a -> IO a
134−ghcWrapper
135− = GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut
136− . GHC.runGhc (Just libdir)
134+ghcWrapper act =
135+ let GHC.FlushOut flushOut = GHC.defaultFlushOut
136+ in GHC.runGhc (Just libdir) act
137+ `finally` flushOut
137138
138139-- | Run a 'GHC.P' computation.
139140