aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main.hs')
-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)