-#if __GLASGOW_HASKELL__ < 609
-rethrow dflags io = Exception.catch io $ \e -> do -- NB. not catchDyn
- case e of
- -- If -fbreak-on-error, we break unconditionally,
- -- but with care of not breaking twice
- _ | dopt Opt_BreakOnError dflags &&
- not(dopt Opt_BreakOnException dflags)
- -> poke exceptionFlag 1
-
- -- If it is an "Interrupted" exception, we allow
- -- a possible break by way of -fbreak-on-exception
- DynException d | Just Interrupted <- fromDynamic d
- -> return ()
-
- -- In any other case, we don't want to break
- _ -> poke exceptionFlag 0
-
- Exception.throwIO e
-#else
-rethrow dflags io = Exception.catch io $ \se@(SomeException e) -> do