Use the HAS_PENDING_EXCEPTION and CLEAR_PENDING_EXCEPTION macros Reviewed-by: dholmes, coleenp, dcubed