From 84862235d051b21b1ca40af5da83b3aad918989a Mon Sep 17 00:00:00 2001 From: David Waern Date: Mon, 15 Nov 2010 21:31:25 +0000 Subject: Match all AsyncExceptions in exception handler --- src/Main.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index 1c5eb102..995e1aac 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -78,9 +78,16 @@ handleNormalExceptions inner = (inner `onException` hFlush stdout) `catches` [ Handler (\(code :: ExitCode) -> exitWith code) - , Handler (\(StackOverflow) -> do - putStrLn "stack overflow: use -g +RTS -K to increase it" - exitFailure) + + , Handler (\(ex :: AsyncException) -> + case ex of + StackOverflow -> do + putStrLn "stack overflow: use -g +RTS -K to increase it" + exitFailure + _ -> do + putStrLn ("haddock: " ++ show ex) + exitFailure) + , Handler (\(ex :: SomeException) -> do putStrLn ("haddock: internal Haddock or GHC error: " ++ show ex) exitFailure) -- cgit v1.2.3