NewNullIsProhibited() public static method

This is intended to MsgPack for CLI internal use. Do not use this type from application directly. Returns new exception to notify that the member cannot be null or the unpacking value cannot be nil because nil value is explicitly prohibitted.
public static NewNullIsProhibited ( string memberName ) : Exception
memberName string The name of the member.
return System.Exception
        private static void VerifyNilImplication(Type type, IEnumerable <SerializingMember> entries)
        {
            foreach (var serializingMember in entries)
            {
                if (serializingMember.Contract.NilImplication == NilImplication.Null)
                {
                    var itemType = serializingMember.Member.GetMemberValueType();

                    if (itemType != typeof(MessagePackObject) &&
                        itemType.GetIsValueType() &&
                        Nullable.GetUnderlyingType(itemType) == null)
                    {
                        throw SerializationExceptions.NewValueTypeCannotBeNull(serializingMember.Member.ToString(), itemType, type);
                    }

                    bool         isReadOnly;
                    FieldInfo    asField;
                    PropertyInfo asProperty;
                    if ((asField = serializingMember.Member as FieldInfo) != null)
                    {
                        isReadOnly = asField.IsInitOnly;
                    }
                    else
                    {
                        asProperty = serializingMember.Member as PropertyInfo;
// 20150616 applibot modify
//#if DEBUG && !UNITY_IPHONE && !UNITY_ANDROID
#if DEBUG && !UNITY_IPHONE && !UNITY_ANDROID && !UNITY
                        Contract.Assert(asProperty != null, serializingMember.Member.ToString());
#endif
                        isReadOnly = asProperty.GetSetMethod() == null;
                    }

                    if (isReadOnly)
                    {
                        throw SerializationExceptions.NewNullIsProhibited(serializingMember.Member.ToString());
                    }
                }
            }
        }