do not assume we can acquire getLocallyAllowedTypes

It seems in some test scenarios getLocallyAllowedTypes is not always available. In this case, instead of raising an AttributeError, raise an InvalidParameterError with a helpful error string.