Skip to content

Exception.try doesn't catch Arith Exc

Exception.try fails to catch an arithmetic exception.

Running:

import Exception

main = do r <- try (evaluate (3 `div` 0))
          case r of Right v -> error "unexpected success"
                    Left e -> print $ "caught: " ++ show e

interpreted or compiled, results in:

Arithmetic Exception
Trac metadata
Trac field Value
Version 5.02
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution ResolvedRejected
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information