[project @ 2000-02-15 11:24:20 by sewardj]
authorsewardj <unknown>
Tue, 15 Feb 2000 11:24:20 +0000 (11:24 +0000)
committersewardj <unknown>
Tue, 15 Feb 2000 11:24:20 +0000 (11:24 +0000)
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.

ghc/lib/std/PrelHugs.lhs

index 23a106f..6df8cc6 100644 (file)
@@ -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