REQUIRE is a more compact version for if+SG_ERROR.