[commit: ghc] master: Print details of panic messages raised from GHCi (#7844) (78d5644)

Ian Lynagh igloo at earth.li
Sun Apr 21 15:27:51 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/78d564483514e7e06cda95da7d0b51526ea2ba91

>---------------------------------------------------------------

commit 78d564483514e7e06cda95da7d0b51526ea2ba91
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Wed Apr 17 11:22:29 2013 -0400

    Print details of panic messages raised from GHCi (#7844)

>---------------------------------------------------------------

 ghc/InteractiveUI.hs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 263babe..9c7104f 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)





More information about the ghc-commits mailing list