exception handling: exitWith ExitSuccess results in abnormal termination with Control.OldException
|Reported by:||int-e||Owned by:||igloo|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
Consider this program.
import System.Exit import Control.OldException main = exitWith ExitSuccess `finally` return ()
It should not produce any output and return 0 as its exit code. Instead we get:
# runhaskell test.hs exit: ExitSuccess # echo $? 1
The problem is that
finally catches the exception and rethrows it. In the process, the
OldException module maps exceptions to old exceptions, but never maps them back when they're thrown.