diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2013-04-17 11:22:29 -0400 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-04-21 13:19:14 +0100 |
commit | 78d564483514e7e06cda95da7d0b51526ea2ba91 (patch) | |
tree | 6e6b3ed6b8c1edd7b5ba0f7d4e276bfa13c8cfce /ghc | |
parent | 157ac08b6f5bc49aa456c185dc519edd9848047b (diff) | |
download | haskell-78d564483514e7e06cda95da7d0b51526ea2ba91.tar.gz |
Print details of panic messages raised from GHCi (#7844)
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/InteractiveUI.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 263babeafc..9c7104fb43 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -2947,9 +2947,10 @@ showException se = -- in an exception loop (eg. let a = error a in a) the ^C exception -- may never be delivered. Thanks to Marcin for pointing out the bug. -ghciHandle :: ExceptionMonad m => (SomeException -> m a) -> m a -> m a -ghciHandle h m = gmask $ \restore -> - gcatch (restore m) $ \e -> restore (h e) +ghciHandle :: (HasDynFlags m, ExceptionMonad m) => (SomeException -> m a) -> m a -> m a +ghciHandle h m = gmask $ \restore -> do + dflags <- getDynFlags + gcatch (restore (GHC.prettyPrintGhcErrors dflags m)) $ \e -> restore (h e) ghciTry :: GHCi a -> GHCi (Either SomeException a) ghciTry (GHCi m) = GHCi $ \s -> gtry (m s) |