I am not sure how dangerous it is, but if an exception is thrown the return value is undefined. It may make the code uglier, but I think for correctness we should consider checking the exception object after each call. If it's non-NULL we should consider returning a default value (0.0 for double, NULL for reference types, etc).