[commit: ghc] master: ghci: write exceptions to stderr (#5980) (739a009)

Paolo Capriotti p.capriotti at gmail.com
Mon Apr 23 16:58:20 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/739a009be27e96384e73ec63c309ac642cb0ef79

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

commit 739a009be27e96384e73ec63c309ac642cb0ef79
Author: Paolo Capriotti <p.capriotti at gmail.com>
Date:   Thu Apr 19 13:28:47 2012 +0100

    ghci: write exceptions to stderr (#5980)

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

 ghc/InteractiveUI.hs |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 8d6e23c..75e8ca0 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -2837,14 +2837,16 @@ showException :: SomeException -> GHCi ()
 showException se =
   liftIO $ case fromException se of
            -- omit the location for CmdLineError:
-           Just (CmdLineError s)    -> putStrLn s
+           Just (CmdLineError s)    -> putException s
            -- ditto:
-           Just ph@(PhaseFailed {}) -> putStrLn (showGhcException ph "")
-           Just other_ghc_ex        -> print other_ghc_ex
+           Just ph@(PhaseFailed {}) -> putException (showGhcException ph "")
+           Just other_ghc_ex        -> putException (show other_ghc_ex)
            Nothing                  ->
                case fromException se of
-               Just UserInterrupt -> putStrLn "Interrupted."
-               _                  -> putStrLn ("*** Exception: " ++ show se)
+               Just UserInterrupt -> putException "Interrupted."
+               _                  -> putException ("*** Exception: " ++ show se)
+  where
+    putException = hPutStrLn stderr
 
 
 -----------------------------------------------------------------------------





More information about the Cvs-ghc mailing list