From: sewardj Date: Tue, 15 Feb 2000 11:24:20 +0000 (+0000) Subject: [project @ 2000-02-15 11:24:20 by sewardj] X-Git-Tag: Approximately_9120_patches~5132 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f460a89b3e089dcf47c67ed747687b91dd80d5fd;p=ghc-hetmet.git [project @ 2000-02-15 11:24:20 by sewardj] In hugsprimRunIO_toplevel, use catchException instead of catch. At least exceptions can then be caught, although Hugs then goes on to die with an assertion failure in unblockAsyncExceptionszh_ret_entry, probably caused by wrongly entering it twice in immediate succession. --- diff --git a/ghc/lib/std/PrelHugs.lhs b/ghc/lib/std/PrelHugs.lhs index 23a106f..6df8cc6 100644 --- a/ghc/lib/std/PrelHugs.lhs +++ b/ghc/lib/std/PrelHugs.lhs @@ -32,7 +32,7 @@ import PrelNum import PrelReal(Integral) import Prelude(fromIntegral) import IO(putStr,hFlush,stdout,stderr) -import PrelException(catch) +import PrelException(catch,catchException) import PrelIOBase(IO,unsafePerformIO) import PrelShow(show,shows,showString,showChar,Show,ShowS) import PrelRead(Read,ReadS,lex,reads) @@ -129,12 +129,11 @@ hugsprimRunIO_toplevel m = primCatch (protect (n-1) comp) (\e -> fst (unST (putStr (show e ++ "\n")) realWorld)) -} + hugsprimRunIO_toplevel :: IO a -> () hugsprimRunIO_toplevel m - = unsafePerformIO ( - catch (m >> hFlush stderr >> hFlush stdout) - (\e -> putStr (show e ++ "\n")) - ) - - + = unsafePerformIO ( + catchException (m >> hFlush stderr >> hFlush stdout) + (\e -> putStr ("error: " ++ show e ++ "\n")) + ) \end{code} \ No newline at end of file