diff options
author | David Waern <david.waern@gmail.com> | 2010-11-15 21:31:25 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2010-11-15 21:31:25 +0000 |
commit | 84862235d051b21b1ca40af5da83b3aad918989a (patch) | |
tree | 4a25ca5ea6a867ab7ce273b8b230084c98fceb2a | |
parent | ca481d8ccb25f1a912028d1af7e67c6c7905c418 (diff) |
Match all AsyncExceptions in exception handler
-rw-r--r-- | src/Main.hs | 13 |
1 files changed, 10 insertions, 3 deletions
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<size> to increase it" - exitFailure) + + , Handler (\(ex :: AsyncException) -> + case ex of + StackOverflow -> do + putStrLn "stack overflow: use -g +RTS -K<size> to increase it" + exitFailure + _ -> do + putStrLn ("haddock: " ++ show ex) + exitFailure) + , Handler (\(ex :: SomeException) -> do putStrLn ("haddock: internal Haddock or GHC error: " ++ show ex) exitFailure) |