From 78d564483514e7e06cda95da7d0b51526ea2ba91 Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Wed, 17 Apr 2013 11:22:29 -0400 Subject: Print details of panic messages raised from GHCi (#7844) --- ghc/InteractiveUI.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ghc') 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) -- cgit v1.2.1