Commit 78d56448 authored by parcs's avatar parcs Committed by ian@well-typed.com
Browse files

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

parent 157ac08b
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment