aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2010-11-15 21:31:25 +0000
committerDavid Waern <david.waern@gmail.com>2010-11-15 21:31:25 +0000
commit84862235d051b21b1ca40af5da83b3aad918989a (patch)
tree4a25ca5ea6a867ab7ce273b8b230084c98fceb2a /src
parentca481d8ccb25f1a912028d1af7e67c6c7905c418 (diff)
Match all AsyncExceptions in exception handler
Diffstat (limited to 'src')
-rw-r--r--src/Main.hs13
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)