fix potential hole in userCode.

This makes userCode catch errors even when the
user does something like (return undefined).
This commit is contained in:
David Roundy
2007-10-12 15:02:53 +00:00
parent 49f64197b2
commit 6dba9ddeb3

View File

@@ -98,7 +98,7 @@ catchX (X job) (X errcase) = do
-- | Execute the argument, catching all exceptions. Either this function or
-- catchX should be used at all callsites of user customized code.
userCode :: X () -> X ()
userCode a = catchX a (return ())
userCode a = catchX (a >> return ()) (return ())
-- ---------------------------------------------------------------------
-- Convenient wrappers to state