From 6dba9ddeb3e2d916b05b21332f6987608c37faa0 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Fri, 12 Oct 2007 15:02:53 +0000 Subject: [PATCH] fix potential hole in userCode. This makes userCode catch errors even when the user does something like (return undefined). --- XMonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMonad.hs b/XMonad.hs index cf72908..501e684 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -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